Skip to content

Instantly share code, notes, and snippets.

View ckhrysze's full-sized avatar

Chris ckhrysze

View GitHub Profile
def url_available?(url_str)
url = URI.parse(url_str)
Net::HTTP.start(url.host, url.port) do |http|
return http.head(url.request_uri).code == "200"
end
end
@ckhrysze
ckhrysze / gitconfig
Last active January 6, 2016 07:30
My git config
[alias]
co = checkout
ci = commit
b = branch
s = status
st = status
[core]
editor = emacs -Q
[color]
diff = auto
@ckhrysze
ckhrysze / Rails MongoMapper Template.rb
Created November 8, 2011 23:13 — forked from jetspeed/Rails MongoMapper Template.rb
A Rails Template for using MongoMapper
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
# add basic layout to start
file 'app/views/layouts/application.html.erb', <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Application!</title>
@ckhrysze
ckhrysze / gist:1782892
Created February 9, 2012 20:35
Playing with dynamic module inclusion
module Alpha
module Bravo
class Charlie
class Delta
ECHO = 'echo'
FOXTROT = 'foxtrot'
end
end
end
end
#!/usr/bin/env ruby
class HasMethods
def method1
return 3
end
def method2
return 7
end
@ckhrysze
ckhrysze / bog.lua
Last active August 29, 2015 14:01
Misc scripts for computercraft, installed with "pastebin get i7xwQWNU gist"
--
-- author: Ckhrysze
--
-- Assumptions
-- * turtle is already fueled up
function spiralIn(length, width, center)
while true do
@ckhrysze
ckhrysze / custom.el
Last active August 29, 2015 14:02
Emacs custom.el
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(js2-basic-offset 2))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
@ckhrysze
ckhrysze / gist:d97719b18a1c3fa76c18
Created September 25, 2014 18:14
Vagrant setup assuming my base box
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "meteor"
config.vm.network "private_network", ip: "192.168.11.11"
@ckhrysze
ckhrysze / clicker heroes
Created December 4, 2014 23:43
clicker heroes save file
e4y1Jpz6aHGb9G1Hb4GrRlTjagGU9C3HSRG8VKySbL0ARKwFcIyII06iZTmLF1smc52CUWskIomIxchsch31R7Tman2dlXsTb0FTVszVZ1WHQliTOajxIhssIwn9B91rc8msN0o7YGXANAlgULmuVXjSb93DJxkIITjup074f1SJwyiwco2ZVwjVbH2R5Bk1VnGu9sMEYOX7N80NUr2HtapJbfGmxrV2cd2CVGk2IcjDo60VLbC4J1ofa3WDdlo7Z4XBNC0xS6GylRzDd6GA94yRa9WINeBubTmoN2pNZeWR5c0ycqypI86HNQyqwiidZPHxBnzlUN2UFljBcbm5lfmRaKWsN0lnZrEVlXuEVw2K9JyxbUGURnSIZYXrNxlkdNH5MiiXO3jVUZuSMtzDUuxSM5jdgA1EMcTQQe56NszoEh2lMxTtdml6KGzWQ8wYLeCLJRkKagWNRrDjbDGclSjral0s9IukQsWd55j3a5WAV4uud9HzNpUJYnWdImi5OnnRRIy0dxWXUcsiIwnJNirUa1W9xfseQ02a9Zv2b1GcRXvrdp265wzTI1jEpy71IhjbEGiPOAjPAssHIBjOIgi6OejREP0PMeTEc83QMjjhYv19NVTggCxGM9TmkIsPI0j1Mxi7O9jYEA0AM4TGce3mMbj6YTyLO7TvIt3IM4z5YwsFIvjlQiiYOjjYEW0TMRTDcm3gMgj5Y7yOOVTmIl4dM8TnMss2I9j5UCihOrjNEZ0ZMoTYca30Mpj3Uz45M0zgMHyVMYD4gGsjIvjmYviWOVjTEt0UMrT9cU3FM3jlU14uMZzjMnzvN5TnIysgIFj1cViuO6jFEI05MgTzco3QMjjKUn4bOYDWEx3POpTUMHs9I1j1gzipOwjvEe0fMBThcs3jMYj5AK4EOhDPgn3nMODbc5skI3jsk7ieOWjSEC0EM6TNcn3uMAjnU940MCzvcW0hOqDrJY9jLBCLJmmAc9mLVXlIUUmUVEzoc2GsVPjVcJy0IW6GMuCqwyil
@ckhrysze
ckhrysze / unix cmds
Created April 20, 2015 17:45
Useful unixy commands
find . ! -newermt 2013-11-22 ! -type d -delete
find / -xdev -type f -size +100M