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
(use-modules (ice-9 readline)) | |
(activate-readline) |
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
(use-modules (system foreign)) | |
(define crypt | |
(let ((f (pointer->procedure '* (dynamic-func "crypt" (dynamic-link)) | |
(list '* '*)))) | |
(lambda (key salt) | |
(let ((r (f (string->pointer key) (string->pointer salt)))) | |
(pointer->string r))))) | |
(simple-format #t "Test: ~s" (crypt "key" "salt")) |
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
gdb | |
(gdb) file /opt/ruby-2.2.3/bin/ruby | |
(gdb) attach [pid] | |
# output of the C backtrace goes to the gdb console | |
(gdb) eval "backtrace" | |
# output of the Ruby application backtrace below goes to ruby stdout (rails logger?) | |
(gdb) call rb_backtrace() | |
(gdb) continue |
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
ssh -nNT -L [local port]:[remote IP addr]:[remote port] user@machine-with-access-to-remote |
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
for dir in `find . -type d -depth 1`; do | |
cd $dir; | |
if [ -d .git ]; then | |
if git branch -ra | grep -q "$B2\$"; then | |
echo $dir; | |
git diff --shortstat $B1 $B2; | |
fi | |
fi | |
cd ..; | |
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 'rails_erd/diagram/graphviz' | |
RailsERD::Diagram::Graphviz.create |
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
#!/usr/bin/env ruby | |
require 'pleasant_lawyer' | |
git_branch_name = `git symbolic-ref -q HEAD` | |
branch_name = File.basename(git_branch_name).gsub(/_/," ") | |
file = File.open(ARGV[0], 'r') | |
contents = file.read | |
file.close | |
File.open(ARGV[0], 'w') do |file| | |
file.write("B##{PleasantLawyer.convert(branch_name)} ") if branch_name.split(/ /).length == 2 | |
file.write(contents) |
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
section .text | |
global start | |
start: | |
mov rsi, s1 ; esi = &s1 | |
mov rdi, s2 ; edi = &s2 | |
xor rdx, rdx ; edx = 0 | |
loop: | |
mov al, [rsi + rdx] | |
mov bl, [rdi + rdx] | |
inc rdx |
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
git difftool -y -x "colordiff -y -W $COLUMNS" origin/prod origin/master | less -R |