⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
celeryd -I q2_tasks -l info -Q tasks | |
celeryd -I q2_tasks -l info -Q count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git | |
git checkout v`git --version | awk '{print $3}'` | |
cp contrib/completion/git-completion.bash ~/.git-completion.bash | |
cd ~ | |
rm -rf /tmp/git | |
echo -e "source ~/.git-completion.bash" >> .profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dn='dc=math,dc=nccu,dc=edu,dc=tw' | |
username='jim.yeh' | |
uid='jim.yeh' | |
gid='student' | |
cat << EOF > user_example.ldif | |
dn: cn=$username,ou=users,ou=login,$dn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add the filter to your application module | |
angular.module('yourAppName', ['filters']); | |
/** | |
* Truncate Filter | |
* @Param string | |
* @Param int, default = 10 | |
* @Param string, default = "..." | |
* @return string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
gh_url = 'https://api.github.com' | |
req = urllib2.Request(gh_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'), | |
sys = require('sys'); | |
function WSServer(port, ip) { | |
if(!port) throw('You should assign a port to listen.'); | |
this.port = port; | |
this.ip = ip||'127.0.0.1'; | |
this.server = null; | |
var clients = {}; | |
var state = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.exceptions import MiddlewareNotUsed | |
from django.conf import settings | |
import cProfile | |
import pstats | |
import marshal | |
from cStringIO import StringIO | |
class ProfileMiddleware(object): | |
def __init__(self): | |
if not settings.DEBUG: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test.simple import DjangoTestSuiteRunner | |
from django.test import TransactionTestCase | |
from mongoengine import connect | |
class TestRunner(DjangoTestSuiteRunner): | |
def setup_databases(self, **kwangs): | |
db_name = 'testsuite' | |
connect(db_name) | |
print 'Creating test-database: ' + db_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'faraday' | |
require 'json' | |
require 'gitlab' | |
module Redmine | |
Host = nil | |
APIKey = nil |
OlderNewer