⌘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
~/project $ git init | |
~/project $ git add . | |
~/project $ git commit -m "first commit" | |
~/project $ cd ~/Dropbox/git | |
~/Dropbox/git $ mkdir project.git | |
~/Dropbox/git $ cd project.git | |
~/Dropbox/git $ git init --bare | |
~/Dropbox/git $ cd ~/project |
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
#-----数据库schema | |
#attachable 为虚拟属性,为兼容以后的私信notif之类的 | |
create_table :notifications do |t| | |
t.belongs_to :user | |
t.references :attachable, :polymorphic => true | |
t.text :content | |
t.timestamps | |
end | |
add_index :notifications, :user_id | |
add_index :notifications, [:attachable_id, :attachable_type] |
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
~/project $ git init | |
~/project $ git add . | |
~/project $ git commit -m "first commit" | |
~/project $ cd ~/Dropbox/git | |
~/Dropbox/git $ mkdir project.git | |
~/Dropbox/git $ cd project.git | |
~/Dropbox/git $ git init --bare | |
~/Dropbox/git $ cd ~/project |
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 | |
# VPN_GATEWAY is the remote address of the vpn tunnel | |
# when ppp executes this script it will pass several values to it | |
# $5 will hold the remote gateway | |
VPN_GATEWAY=192.168.20.239 | |
if [ "${5:-}" = "${VPN_GATEWAY}" ] | |
then | |
/sbin/route add 192.168.30.0/24 $5 | |
fi |
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
PerlLoadModule Apache::Redmine | |
<Location /svn> | |
DAV svn | |
# SVNPath /srv/svn/repo | |
SVNParentPath /srv/svn | |
AuthName "Subversion repository" |
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
public void testGrizzly(String ip, int port) throws IOException, InterruptedException, ExecutionException, TimeoutException, TException { | |
// init client | |
final FilterChainBuilder clientFilterChainBuilder = FilterChainBuilder.stateless(); | |
clientFilterChainBuilder.add(new TransportFilter()); | |
// clientFilterChainBuilder.add(new ThriftFrameFilter()); | |
clientFilterChainBuilder.add(new ThriftClientFilter()); | |
final TCPNIOTransportBuilder builder = TCPNIOTransportBuilder.newInstance(); | |
final ThreadPoolConfig config = builder.getWorkerThreadPoolConfig(); |
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
class Player | |
@health = nil | |
def play_turn(warrior) | |
# cool code goes here | |
@health = warrior.health unless @health | |
if warrior.feel.empty? | |
if @health < 12 | |
warrior.rest! | |
else | |
warrior.walk! |
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
funds: | |
- | |
code: "375010" | |
capital: 10000 | |
units: 3353 | |
- | |
code: "270002" | |
capital: 5000 | |
units: 2544.47 | |
# and more |