Skip to content

Instantly share code, notes, and snippets.

View killerbees19's full-sized avatar
🐢
I may be slow to respond.

Christian killerbees19

🐢
I may be slow to respond.
View GitHub Profile
@branneman
branneman / example-mod-wsgi.py
Last active June 28, 2024 17:49
pyinfo(). License: MIT
def application(environ, start_response):
import sys
path = 'YOUR_WWW_ROOT_DIRECTORY'
if path not in sys.path:
sys.path.append(path)
from pyinfo import pyinfo
output = pyinfo()
start_response('200 OK', [('Content-type', 'text/html')])
return [output]
@cdown
cdown / gist:1163649
Last active July 1, 2024 03:35
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@leoapost
leoapost / gist:4318441
Created December 17, 2012 13:55
Delete all remote branches, except master
# Replace REMOTE_NAME with your remote name (e.g. origin)
git branch -r | grep REMOTE_NAME/ | grep -v 'master$' | grep -v HEAD| cut -d/ -f2 | while read line; do git push REMOTE_NAME :$line; done;
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@romanbb
romanbb / gist:8011102
Last active April 11, 2022 01:58
compile, push, and start SystemUI.apk
#!/bin/bash
. build/envsetup.sh
mmm frameworks/base/packages/SystemUI/
adb start-server
adb shell pkill -TERM -f com.android.systemui
adb remount
adb push $OUT/system/priv-app/SystemUI.apk /system/priv-app/SystemUI.apk
adb shell pkill -TERM -f com.android.systemui
adb shell chmod 0644 /system/app-priv/SystemUI.apk
sleep 2
@glnds
glnds / less-cheatsheet.md
Last active July 12, 2024 08:29
Less Cheatsheet

Less Cheatsheet

less {filename}

Navigation
SPACE forward one window
b backward one window
d forward half window
@christophmeissner
christophmeissner / multilingual-static-nginx.conf
Last active May 5, 2023 21:55
Naive multilingual static file serving with nginx using Accept-Language
#
# Naive multilingual static file serving with nginx
#
# Requests to root (/) will be redirected to language-prefixed sub location
# according to Accept-Language header. Supports only the first language in the
# Accept-Language header field.
#
# At any other location than /: Tries requested resource at given location and
# falls back to root directory (will function as default language).
#
@wvengen
wvengen / scanner.rb
Last active February 22, 2024 13:31
Hack to use Android phone as barcode scanner for pc
#!/usr/bin/env ruby
#
# Hack to use Android phone as barcode scanner for pc.
#
# Installation and setup:
# * Enable usb debugging on your Android phone
# * Make sure you have an Android SDK installed
# * Make sure xdotool is installed (apt-get has it) http://www.semicomplete.com/projects/xdotool/
# * Build and install https://github.com/majido/clipper
# * Start service: `adb shell su -c \'am startservice ca.zgrs.clipper/.ClipboardService\'`
@artizirk
artizirk / readme.txt
Created April 10, 2015 19:34
Huawei E3372h-153
Working Huawei E3372h-153 SETPORT mappings
replacing A1,A2 with FF turns off need for usb_modeswitch
AT^SETPORT="A1,A2;12,1,16,A1,A2"
^GETPORTMODE: TYPE: WCDMA: huawei,PCUI:0,MDM:1,NDIS:2,CDROM:3,SD:4,
AT^SETPORT="A1,A2;1,12,16,A1,A2"
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active July 11, 2024 16:08
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)