This file contains 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' | |
s=TCPServer.new(8888) | |
loop { | |
c=s.accept | |
f = 'public' + c.gets.split[1] | |
c<<"HTTP/1.0 200 OK\r\n\r\n#{File.read(f)rescue nil}" | |
c.close | |
} |
This file contains 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
# ruby migrate.rb <app-name> | |
app = ARGV[0] | |
require 'heroku' | |
hc = Heroku::Client.new(ENV['HEROKU_USER'], ENV['HEROKU_PASS']) | |
response = hc.install_addon(app, 'heroku-postgresql:dev') | |
puts response | |
db = response['message'][/HEROKU_POSTGRESQL_\w+/] |
This file contains 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 'heroku' | |
module Background | |
class HerokuScaler | |
def initialize( | |
type = 'worker', | |
user = ENV['HEROKU_USER'], | |
pass = ENV['HEROKU_PASS'], | |
app = ENV['HEROKU_APP']) | |
@client = Heroku::Client.new(user, pass) |
This file contains 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 'benchmark' | |
$require_depth = 0 | |
module TimedRequire | |
LIMIT = 0.0 | |
def require(path) | |
#puts " #{' '*$require_depth}>>#{path}" | |
begin | |
$require_depth += 1 | |
t = 0.0 | |
t = Benchmark.realtime {super} |
This file contains 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
module UserList exposing (users) | |
users : List (String, List String) | |
users = | |
[ ("LacyRayAnne", ["4-6000kpbs"]) | |
, ("RCJackman", []) | |
, ("BeebsTW", []) | |
, ("KnightJvor", []) | |
, ("FoxQueen", []) | |
, ("Grizzlybeer77", ["sometimes music"]) |
This file contains 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
obs = obslua | |
local function script_log(message) | |
obs.script_log(obs.LOG_INFO, message) | |
end | |
local function dump_obs() | |
local keys = {} | |
for key,_ in pairs(obs) do | |
keys[#keys+1] = key |
This file contains 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
[ | |
{ | |
"name": "Twitch.ClipsV2.Decode", | |
"comment": " Decoders for the Clips API at `clips.twitch.tv/api/v2/clips/` Note that this is an unofficial API, requests should be made with Http.send rather than Twitch.Helix.send.\n\n@docs Clip, clip, sampleClip\n", | |
"aliases": [ | |
{ | |
"name": "Clip", | |
"comment": " Record for decoded clip data.\n", | |
"args": [], | |
"type": "{ broadcasterChannelUrl : String , broadcasterDisplayName : String , broadcasterId : String , broadcasterLogin : String , broadcasterLogo : String , broadcastId : String , curatorChannelUrl : String , curatorDisplayName : String , curatorId : String , curatorLogin : String , curatorLogo : String , previewImage : String , thumbnails : Dict.Dict String String , communities : List String , createdAt : Time.Time , title : String , language : String , infoUrl : String , statusUrl : String , editUrl : String , vodId : Maybe.Maybe String , vodUrl : Maybe.Maybe String , vodOffset : Maybe.Maybe Int , vodPreviewImageUrl |
This file contains 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
:scriptencoding utf-8 | |
let mapleader="," | |
let maplocalleader=",," | |
let g:ctrlp_map = '<leader>t' | |
let g:ctrlp_cmd = 'CtrlP' | |
let g:ctrlp_working_path_mode = '' | |
"let g:ctrlp_max_height = 100 | |
" |