Skip to content

Instantly share code, notes, and snippets.

View dacook's full-sized avatar

David Cook dacook

  • Melbourne, Australia
View GitHub Profile
@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created September 14, 2015 17:28
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active April 25, 2024 01:57
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@daimatz
daimatz / httpd.py
Created July 23, 2014 17:34
SimpleHTTPServer with custom headers
#!/usr/bin/env python
import SimpleHTTPServer
import BaseHTTPServer
import sys
"""
Usage:
python httpd.py [port] [additional headers ...]
##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@joshmfrankel
joshmfrankel / convertTwoSpacesToFour.sublime-macro
Created June 4, 2013 15:50
Sublime: Convert 2 Spaces to 4
[
{
"args": null,
"command": "select_all"
},
{
"args":
{
"set_translate_tabs": true
},
@akgupta
akgupta / quotaexceeded.js
Created March 17, 2012 22:12
handle quota exceeded error in local storage
try {
module.$localStorage[key] = serializer(value);
} catch(e) {
if(e.name === 'QUOTA_EXCEEDED_ERR') {
// reset to make space
module.reset();
module.$localStorage[key] = serializer(value);
} else {
module.localStorageAvailable = false;
$log.error("Local storage write failure - " + e);