Skip to content

Instantly share code, notes, and snippets.

View dorentus's full-sized avatar
🎲
🌎🌍🌏

ZHANG Yi dorentus

🎲
🌎🌍🌏
View GitHub Profile
//
// ansi.swift
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyright (C) 2015 Zhang Yi <[email protected]>
//
// Everyone is permitted to copy and distribute verbatim or modified
#!/usr/bin/env xcrun swift
import Foundation
import CoreText
func input_from_stdin() -> String {
var input = ""
let stdin = FileHandle.standardInput
let zeroData = Data()
while true {
let input_data = stdin.availableData
convert -crop 120x120+487+49 screenshot.png [email protected]
#!/usr/bin/env ruby
begin
require 'unicorn'
rescue LoadError
abort "Required gem not found: unicorn"
end
if not File.exists? 'config.ru'
abort "Required file not found: ./config.ru"
@dorentus
dorentus / AppDelegate.swift
Last active August 29, 2015 14:04
iBeacon Demo
import UIKit
import CoreLocation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate {
var window: UIWindow?
var locationManager: CLLocationManager!
set shell=/bin/sh " fix for fish
set nocompatible " be iMproved
filetype on " see: http://unix.stackexchange.com/questions/14497/
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
@dorentus
dorentus / dig+trace.txt
Last active August 29, 2015 14:04
dig be.a.rubyist.today +dnssec +trace
└───🌐 dig t0.example.rubyist.today +dnssec +trace
; <<>> DiG 9.9.5-4-Debian <<>> t0.example.rubyist.today +dnssec +trace
;; global options: +cmd
. 1037 IN NS e.root-servers.net.
. 1037 IN NS b.root-servers.net.
. 1037 IN NS c.root-servers.net.
. 1037 IN NS a.root-servers.net.
. 1037 IN NS g.root-servers.net.
. 1037 IN NS h.root-servers.net.
  • Vagrantfile

  • boot2docker.fish

    • Fish-shell script
    • $__docker_vagrant_box_dir: folder for vagrant box, defaults to ~/opt/vagrant/docker, created from Vagrantfile if not exists. You might want to change it to a different location or use a different vagrant box.
    • function docker: bring up the vagrant box and run the original docker command
    • function turn_off_docker_vagrant_box : halt the vagrant box
#!/usr/bin/env ruby
require 'rb-inotify'
if ARGV.count < 3
puts "Usage: #{File.basename $0} <path> <signal> <cmd>"
exit 1
end
path = ARGV[0]
signal = ARGV[1].to_sym