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 bash | |
| set -e | |
| # Requirements: | |
| # fzz - github.com/mrnugget/fzz | |
| # selecta - github.com/garybernhardt/selecta | |
| # the_silver_searcher/ag - github.com/ggreer/the_silver_searcher | |
| # Usage: | |
| # n [name] - Create note |
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
| class TestGlobFormatConstraints < ActionDispatch::IntegrationTest | |
| Routes = ActionDispatch::Routing::RouteSet.new.tap do |app| | |
| app.draw do | |
| ok = lambda { |env| [200, { 'Content-Type' => 'text/plain' }, []] } | |
| # tests fail with these: | |
| get '/*id', to: ok, constraints: { format: 'html' } | |
| #get '/*id', to: ok, constraints: { format: /html/ } | |
| # tests succeed with this: |
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
| #include <string.h> | |
| #include <stdio.h> | |
| #define MEM_SIZE 30000 | |
| char mem[MEM_SIZE] = {0}; | |
| char *memp = mem; | |
| void bf_eval(char *code, int len, FILE *in, FILE *out) | |
| { |
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
| class Brainfuck | |
| attr_accessor :memory | |
| attr_accessor :memory_pointer | |
| attr_accessor :code | |
| attr_accessor :ip | |
| attr_accessor :input | |
| attr_accessor :output |
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/bash | |
| # ag is the_silver_searcher (https://github.com/ggreer/the_silver_searcher) | |
| ag TODO | while read line; do | |
| file=$(echo ${line} | awk -F ':' '{print $1}'); | |
| lineno=$(echo ${line} | awk -F ':' '{print $2}'); | |
| git blame --line-porcelain "./${file}" -L ${lineno},${lineno} | grep author-mail | cut -d ' ' -f 2; | |
| done | sort | uniq -c |
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
| function! Fzz(...) | |
| let l:fzz_executable = "fzz" | |
| if !executable(l:fzz_executable) | |
| echoe "Fzz command '" . l:fzz_executable . "' not found. Is in your $PATH?" | |
| return | |
| endif | |
| let l:ag_cmd = "ag --nogroup --nocolor" | |
| let l:ag_executable = get(split(l:ag_cmd, " "), 0) | |
| if !executable(l:ag_executable) |
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 'socket' | |
| sock1 = Socket.new(:INET, :STREAM) | |
| addr1 = Socket.pack_sockaddr_in(8888, '0.0.0.0') | |
| sock1.bind(addr1) | |
| sock1.listen(10) | |
| sock2 = Socket.new(:INET, :STREAM) | |
| addr2 = Socket.pack_sockaddr_in(9999, '0.0.0.0') | |
| sock2.bind(addr2) |
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
| DOTFILE_PATH := $(shell pwd) | |
| $(HOME)/.%: % | |
| ln -sf $(DOTFILE_PATH)/$^ $@ | |
| irb: $(HOME)/.irbrc | |
| ack: $(HOME)/.ackrc | |
| git: $(HOME)/.gitconfig $(HOME)/.githelpers $(HOME)/.gitignore | |
| psql: $(HOME)/.psqlrc | |
| zsh: $(HOME)/.zprofile |
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
| cdfzz() { | |
| local file=$(fzz find . -iname "*{{}}*" | head -n 1) | |
| local filedir=$(dirname ${file}) | |
| cd ${filedir} | |
| } |
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
| mkdir /usr/local/var/postgres/pg_tblspc | |
| mkdir /usr/local/var/postgres/pg_twophase | |
| mkdir /usr/local/var/postgres/pg_stat_tmp | |
| mkdir /usr/local/var/postgres/pg_stat |