Skip to content

Instantly share code, notes, and snippets.

@YukiGasai
YukiGasai / view.js
Created May 10, 2023 22:38
Obsidian Chart Sleep Tracker
let pages = dv
.pages('#DailyNote')
.filter(p => p.date.day != undefined)
.filter(p => p.sleepStart != undefined)
.sort(p => p.date);
if (input.range) pages = pages.slice(input.range * -1);
let timeDate = pages.date;
const ratingData = pages.rating;
@cupnoodle
cupnoodle / IAPHelper.swift
Created July 21, 2020 09:51
In app purchase helper class
// Created by Soulchild on 21/07/2020.
// Copyright © 2020 fluffy. All rights reserved.
//
import Foundation
import StoreKit
// Need to install the TPInAppReceipt library first
import TPInAppReceipt
@elsayed85
elsayed85 / imei-eg.sh
Last active January 1, 2025 02:57
Replace 351941237314725 With Your IMEI
curl 'https://api-citizens-prod-imei.gs-ef.com/ceirimeicheck/api/v1/imei/check'
-H 'Host: api-citizens-prod-imei.gs-ef.com'
-H 'Content-Type: application/json'
-H 'Accept: */*'
-H 'Connection: keep-alive'
-H 'Accept-Language: en'
-H 'Content-Length: 34'
-H 'Accept-Encoding: gzip, deflate, br'
-H 'User-Agent: CitizenApp_Ntra/1.0.0 CFNetwork/1568.300.101 Darwin/24.2.0'
--data '{"imeiNumber":["351941237314725"]}'
@majikayogames
majikayogames / _push_away_rigid_bodies.txt
Last active January 1, 2025 02:48
Godot 4 CharacterBody3D to RigidBody3D Push Interaction Script
# CC0/public domain/use for whatever you want no need to credit
# Call this function directly before move_and_slide() on your CharacterBody3D script
func _push_away_rigid_bodies():
for i in get_slide_collision_count():
var c := get_slide_collision(i)
if c.get_collider() is RigidBody3D:
var push_dir = -c.get_normal()
# How much velocity the object needs to increase to match player velocity in the push direction
var velocity_diff_in_push_dir = self.velocity.dot(push_dir) - c.get_collider().linear_velocity.dot(push_dir)
# Only count velocity towards push dir, away from character
@rbialek
rbialek / config
Created June 7, 2011 13:32
ssh/.config
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile /home/user/.ssh/id_rsa
@dasdom
dasdom / navigationProblem.swift
Last active January 1, 2025 02:45
SwiftUI identity problem
import SwiftUI
struct CoverWithBoolView: View {
@State var presentCover: Bool = false
var body: some View {
GeometryReader { proxy in
ZStack {
if proxy.size.height > proxy.size.width {
Color.gray

How to install Doom Emacs on Ubuntu 24.04.1 LTS or (24.10) Easily.

Using doom-emacs-install-scripts: It is possible to compile and install Doom Emacs with one command.

curl -fsSL https://github.com/infstate/doom-emacs-install-scripts/raw/refs/heads/main/doom-universal-linux.sh |  sh

This script should install the requirements for building Emacs 29.4 + native comp on Ubuntu 24.04.1 LTS or Ubuntu 24.10.

There are also other scripts in case you are on other distros or want to install less packages.

@dave1029
dave1029 / gist:6509593
Created September 10, 2013 13:44
/etc/apk/world
alpine-base
bridge
openssh
chrony
xen
sfdisk
e2fsprogs
lvm2
syslinux
acct
@Pulimet
Pulimet / AdbCommands
Last active January 1, 2025 02:31
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@styblope
styblope / docker-api-port.md
Last active January 1, 2025 02:28
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}