Skip to content

Instantly share code, notes, and snippets.

@GabrielMMelo
GabrielMMelo / sudo-termux
Created January 22, 2019 12:33
Install sudo in Termux (Android)
apt install git
git clone https://gitlab.com/st42/termux-sudo
cd termux-sudo
cat sudo > /data/data/com.termux/files/usr/bin/sudo
chmod 700 /data/data/com.termux/files/usr/bin/sudo
@hirbod
hirbod / withDisableForcedDarkModeAndroid.js
Last active May 13, 2024 19:47
Expo Config Plugin to disable forced Dark mode.
// disable forced dark mode to prevent weird color changes on
// certain android devices (Xiaomi MIUI and others enforcing dark mode with view analyzing)
// create a file like "plugins/withDisableForcedDarkModeAndroid.js". Insert this content and edit your app.config.js/app.json
/*
"expo": {
...
...
...
"plugins": [
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 13, 2024 19:45
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@cprovatas
cprovatas / Data+PrettyPrint.swift
Created May 23, 2018 15:52
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
}
@texodus
texodus / .block
Last active May 13, 2024 19:43 — forked from JHawk/.block
Perspective NYC Citibike Example
license: apache-2.0
@ksmithut
ksmithut / .dockerignore
Last active May 13, 2024 19:41
Node Docker Compose nodemon
node_modules
@rsms
rsms / macos-distribution.md
Last active May 13, 2024 19:40
macOS distribution — code signing, notarization, quarantine, distribution vehicles
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 13, 2024 19:40 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@cmer
cmer / waketv.lua
Last active May 13, 2024 19:34
Wake TV when MacOS wakes from sleep (Hammerspoon)
-- -------------------------------------------------------------------
-- THIS SCRIPT IS NOW DEPRECATED IN FAVOR OF A MORE ROBUST SOLUTION --
-- Please refer to https://github.com/cmer/lg-tv-control-macos/
-- -------------------------------------------------------------------
local tv_identifier = "LG TV"
local mac_address = "aa:bb:cc:dd:ee:ff"
local tv_found = (hs.screen.find(tv_identifier) ~= nil)
local debug = false -- Set to true to enable debug messages