Skip to content

Instantly share code, notes, and snippets.

View jostyee's full-sized avatar
💭
脑壳疼

Josta Yee jostyee

💭
脑壳疼
  • Singapore
View GitHub Profile
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@pklaus
pklaus / AlwaysMountRootFSWithNoatime_MacOSX.sh
Created April 20, 2011 15:08
SSD Optimizations of Mac OS X 10.6 Operating System
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Mount the root file system / with the option noatime |
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | Tip found on <http://blogs.nullvision.com/?p=275> |
# | |
# +----------------------------------------------------------------------+
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@rwest
rwest / README
Created January 9, 2012 16:42 — forked from symposion/README
Convert OS X Keychain exported entries into logins for 1Password import
These two files should help you to import passwords from mac OS X keychains to 1password.
Assumptions:
1) You have some experience with scripting/are a power-user. These scripts worked for me
but they haven't been extensively tested and if they don't work, you're on your own!
Please read this whole document before starting this process. If any of it seems
incomprehensible/frightening/over your head please do not use these scripts. You will
probably do something Very Bad and I wouldn't want that.
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they
@tsuna
tsuna / mysqlpool.scala
Created March 30, 2012 00:15
MySQL JDBC connection pool for Scala + Finagle
// Copyright (C) 2012 Benoit Sigoure
// Copyright (C) 2012 StumbleUpon, Inc.
// This library is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version. This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
// General Public License for more details. You should have received a copy
// of the GNU Lesser General Public License along with this program. If not,
@jboner
jboner / latency.txt
Last active May 3, 2024 01:00
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 1, 2024 03:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@github101
github101 / gist:3426232
Created August 22, 2012 14:39
提高MySQL数据的导出速度
在导出数据之前,先设置两个值 max_allowed_packet 128M~256M或者更大,参考内存的使用量;net_buffer_length 一般设置成16384。在使用mysqldump导出数据的时候增加两个三个参数 -e --max_allowed_packet=128M --=net_buffer_length=16384
@github101
github101 / gist:3426337
Created August 22, 2012 14:48
AWS EC2 时区设置
设置时区
ec2实例和国外vps默认的时区都是当地的,不适合国内使用,通过手动修改自己的时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date一下看看已经更改过来了
@lg0
lg0 / gist:3481797
Last active October 9, 2015 09:37
解决 OSX 上原生 VPN (Cisco IPSec)每隔一小时要求输入密码的情况

解决方案来自:[Apple Support Communities] (https://discussions.apple.com/thread/3275811?start=0&tstart=0)

  1. 连接 VPN Cisco IPSec (让系统生成配置文件)
  2. 拷贝配置文件到/etc/racoon打开终端执行:
    $ sudo cp /var/run/racoon/xxx.xxx.xxx.xxx.conf /etc/racoon
  3. 修改 racoon 配置文件:
    $ sudo vim /etc/racoon/racoon.conf
  4. 将最后一行注释掉(目的是不使用系统生成配置):
    # include "/var/run/racoon/*.conf" ;
  5. 将下面一行添加到文件末尾,包含分号(使用定制的配置文件):