Skip to content

Instantly share code, notes, and snippets.

View knksmith57's full-sized avatar

Kyle Smith knksmith57

View GitHub Profile
@knksmith57
knksmith57 / domainr.sh
Created February 14, 2013 02:39
domainr shell script
#!/usr/bin/env ruby
# encoding: utf-8
# From @jerodsanto
# http://blog.jerodsanto.net/2012/11/a-domainr-cli-in-less-than-15-lines-of-ruby/
%w(json open-uri).each { |lib| require lib }
abort "Usage: #{File.basename __FILE__} [query]" unless ARGV.first
response = open("http://domai.nr/api/json/search?q=#{ARGV.first}").read
var http = require('http');
var sys = require('sys');
var exec = require('child_process').exec;
var util = require('util');
var fs = require('fs');
http.createServer(function(request, response) {
var dummyContent = '<!doctype html><html><head><title>Test</title><meta charset="utf-8"></head><body><p>Hello world!</p></body></html>';
var htmlFileName = "page.html", pdfFileName = "page.pdf";
#!/usr/bin/env ruby
temp = 'some-temp-file-that-doesnt-exist'
args = ARGV.shuffle!
last = args.last
cur = args.shift
unless !cur.nil?
# need to provide some args!
@knksmith57
knksmith57 / README.md
Created February 8, 2014 18:32
Host blocking functions for /etc/hosts -- for when you need to get shit done

Host blocking -- For when you need to get shit done

Chill drop-in functions for your .zshrc to make blocking sites quick and easy.

Simply concats the host(s) you say to /etc/hosts with a redirect to 127.0.0.1-- shit ain't original.

Hey {{name of recruiter}},
Thanks for reaching out regarding potential career opportunities with {{company}}!
I appreciate the offer and wish you well on your quest to find good talent. Unfortunately, I’ll have to respectfully decline.
Part of my job as a young professional is knowing my own worth and, on principle, I can’t pursue a lead for a tech company with a recruitment email written in Comic Sans.
All the best!
-{{your name}}
#!/usr/bin/env sh
## sandwiches 1 file (slice.v) into another (d_ff.v) _before_ regex /endmodule/
echo -e "`sed -n '/endmodule/,$!p' d_ff.v`\n`<slice.v`\n`sed -n '/endmodule/,$p' d_ff.v`"
@knksmith57
knksmith57 / gist:f1785e80d6e2f9fa6a4634c8fc98a49b
Created March 30, 2016 18:30
empty nodejs/node release response
❯ curl -i -X GET -H'Accept: application/json' https://api.github.com/repos/nodejs/node/releases
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 30 Mar 2016 18:29:48 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 5
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1459365215
@knksmith57
knksmith57 / gist:00e6f77456b86299e6d24c9940d29ee4
Created March 30, 2016 18:33
correct atom feed response
❯ curl -i -X GET -H'Accept: application/atom+xml' https://github.com/nodejs/node/releases.atom
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 30 Mar 2016 18:32:14 GMT
Content-Type: application/atom+xml; charset=utf-8
Transfer-Encoding: chunked
Status: 200 OK
Cache-Control: no-cache
Vary: X-PJAX
X-UA-Compatible: IE=Edge,chrome=1
{
"name": "knksmith57/lnc-identity-call-stack-error",
"description": "example setup for reproducing LnC #235",
"authors": [
{
"name": "Kyle Smith",
"email": "knksmith57@gmail.com"
}
],
"require": {
#!/usr/bin/env bash -e
instance_name="throw-away-$(date +%s)"
region=us-west1-b
ssh_key_dir="$(mktemp -d)"
cleanup() {
echo "removing temp dir: $ssh_key_dir"
rm -rf "$ssh_key_dir"