This file contains hidden or 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
eager_load -> load all wit left join | |
includes | |
joins |
This file contains hidden or 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
find path -type f | xargs file --mime-encoding | grep us-ascii | cut -d: -f 1 | while read f; do | |
mv $f{,.ascii} | |
echo $f | |
iconv -f UTF-8 -t US-ASCII $f.ascii > $f | |
rm $f.ascii | |
# git add $f | |
done |
This file contains hidden or 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
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
version '7.3.666' | |
url 'https://vim.googlecode.com/hg/', :revision => '1e22adc6176e' | |
head 'https://vim.googlecode.com/hg/' | |
def ruby_bin |
This file contains hidden or 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 to ~/.ssh/config | |
Host yourhost | |
User root | |
HostName yourhost.domain | |
Compression yes | |
ForwardX11 yes | |
CompressionLevel 9 |
This file contains hidden or 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
data = %x{git log -n 1 --decorate --pretty=oneline}.match(/tag: (?<version>\d+\.\d+\.\d+)-(?<release>\w+)/) | |
data[:version] | |
data[:release] |
This file contains hidden or 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
# getting source | |
wget 'http://jruby.org.s3.amazonaws.com/downloads/1.6.5/jruby-bin-1.6.5.tar.gz' --directory-prefix=`rpm --eval '%{_sourcedir}'` | |
git clone [email protected]:jlbfalcao/jruby-rpm.git | |
cd jruby-rpm | |
cp * `rpm --eval '%{_sourcedir}'` | |
# build rpm | |
rpmbuild -bb jruby.spec |
This file contains hidden or 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 | |
BRANCH=`git status --short -b | head -n 1 | awk '{print $2}'` | |
# echo $BRANCH | |
echo "" | |
mkdir -p backups | |
FILE="backups/$BRANCH.sql.gz" | |
if [ "$1" == "restore" ]; then |
This file contains hidden or 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
import java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.InetSocketAddress; | |
import java.net.Socket; | |
import java.nio.channels.SocketChannel; | |
public class LeakTest { | |
public static void main(String[] args) { | |
new LeakTest().test(); |
This file contains hidden or 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 obj = (function() { | |
var list = []; | |
return { | |
f: function() { | |
return list; | |
} | |
} | |
})(); |
This file contains hidden or 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
wget http://jruby.org.s3.amazonaws.com/downloads/1.6.2/jruby-bin-1.6.2.tar.gz | |
tar -xvzf jruby-bin-1.6.2.tar.gz | |
cat > post-install.sh <<EOF | |
echo "PATH=/opt/jruby-1.6.2/bin:\\\${PATH}" > /etc/profile.d/jruby.sh | |
chmod +x /etc/profile.d/jruby.sh | |
EOF | |
cat > pre-uninstall.sh <<EOF | |
rm /etc/profile.d/jruby.sh | |
EOF |
NewerOlder