Skip to content

Instantly share code, notes, and snippets.

View dm4's full-sized avatar
4️⃣

dm4 dm4

4️⃣
View GitHub Profile
{
"100": "1f4af",
"1234": "1f522",
"interrobang": "2049",
"tm": "2122",
"information_source": "2139",
"left_right_arrow": "2194",
"arrow_up_down": "2195",
"arrow_upper_left": "2196",
"arrow_upper_right": "2197",
@dm4
dm4 / Arch_install.md
Last active August 29, 2015 14:10 — forked from xatier/Arch_install.md
@dm4
dm4 / python_resources.md
Last active August 29, 2015 14:10 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@dm4
dm4 / javascript_resources.md
Last active August 29, 2015 14:10 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@dm4
dm4 / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
# A handy j() function, printing some useful info in bash cmdline
j() {
printf '\n\e[0;35m%(%Y/%m/%d (%a) %H:%M:%S)T\e[0m ' -1
printf '\n\e[0;33m%s@%s\e[0m ' "$USER" "${HOSTNAME/.*/}"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local GIT_CLEAN=
local GIT_REF=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
git diff-index --quiet HEAD && GIT_CLEAN=1
# Usage: pr (pull request current branch into develop)
# Usage 2: pr stable (pull request current branch into stable)
function pr() {
base=$1;
if [ "$1" == "" ]; then
base="develop"
fi
hub pull-request -b team:"$base" -h team:`git rev-parse --abbrev-ref HEAD`;
}
@dm4
dm4 / Macros.h
Created February 26, 2013 09:01 — forked from numo16/Macros.h
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define UserDefaults [NSUserDefaults standardUserDefaults]
#define NotificationCenter [NSNotificationCenter defaultCenter]
#define SharedApplication [UIApplication sharedApplication]
#define Bundle [NSBundle mainBundle]
#define MainScreen [UIScreen mainScreen]
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x
#define NavBar self.navigationController.navigationBar
@dm4
dm4 / 自動填教學意見調查
Created December 5, 2011 17:06 — forked from jimmyken793/自動填教學意見調查
自動填教學意見調查
把以下的東西存成bookmark 然後在填答表格那頁點下去 然後Magic!!
javascript:y=document.forms['frm1'].elements;for(var j=1;j<=28;j++){a=y['ans'+j];if(a){var c=a.length;if(c==undefined){a.checked=(a.value=='3')}for(var i=0;i<c;i++){a[i].checked=false;if(a[i].value=='3'){a[i].checked=true}}}}