Skip to content

Instantly share code, notes, and snippets.

View etrepum's full-sized avatar
😎
Currently retired

Bob Ippolito etrepum

😎
Currently retired
View GitHub Profile
@etrepum
etrepum / helpers.rb
Created March 13, 2014 00:29
Sinatra helper to add a url_escape method
helpers do
def escape(text)
Rack::Utils.escape_html(text)
end
def url_escape(text)
chunks = []
after = text
while after != "" do
before, match, after = after.partition(URI.regexp)
if before != ""
@etrepum
etrepum / dice.css
Last active September 29, 2016 18:23
Mission Bit Intro #8 - Dice Game
body {
background: linear-gradient(to top, green, black);
height: 100%;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
color: white;
}
div.game {
@etrepum
etrepum / dice.css
Created February 25, 2014 21:47
Mission Bit Intro #7 - Rolling Dice
body {
background: linear-gradient(to top, green, black);
height: 100%;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
color: white;
}
h1 {
-webkit-user-select: none;
@etrepum
etrepum / chinese.py
Created February 24, 2014 19:30
UTF-16 w/ BOM tab delimited CSV in Excel
>>> open('chinese.csv', 'w').write(u'English\tChinese\r\nChinese\t汉语\r\n'.encode('utf-16'))
>>> open('chinese.csv', 'r').read()
'\xff\xfeE\x00n\x00g\x00l\x00i\x00s\x00h\x00\t\x00C\x00h\x00i\x00n\x00e\x00s\x00e\x00\r\x00\n\x00C\x00h\x00i\x00n\x00e\x00s\x00e\x00\t\x00Il\xed\x8b\r\x00\n\x00'
>>> os.system("open -a 'Microsoft Excel' chinese.csv")
@etrepum
etrepum / clicks.css
Last active August 29, 2015 13:56
Mission Bit Intro #6 - Clicks
.clicked {
color: darksalmon;
}
.logo {
position: absolute;
left: 50%;
top: 50%;
width: 128px;
height: 128px;
margin-left: -64px;
userTimeline :: String -> Maybe Int -> Request
userTimeline name sinceId = fromJust . parseUrl $ concat
[ "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name="
, name
, "&include_rts=false"
, maybe "" (("&since_id=" ++) . show) sinceId
]
@etrepum
etrepum / animation.css
Created February 13, 2014 22:43
Mission Bit Intro 04 - Animation
/*
More information about transforms and transitions:
CSS transforms:
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform
CSS transitions:
* https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions
@etrepum
etrepum / logo.css
Created February 11, 2014 23:12
Mission Bit Intro 03 - Logo
svg {
stroke: none;
width: 500px;
height: 500px;
}
#logo-center {
position: absolute;
top: 80px;
left: 10px;
@etrepum
etrepum / avatar.css
Created February 11, 2014 22:31
Mission Bit Intro 03 - Avatar
/*
Resources:
Learn more about colors here:
- https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
Having trouble with overriding rules? Learn about CSS specificity:
- http://specificity.keegan.st/
$ curl -v -X PUT -H 'Content-Type:application-json' -H 'Transfer-Encoding:chunked' -d @empty_file 'http://127.0.0.1:8000/empty-file'
* About to connect() to 127.0.0.1 port 8000 (#0)
* Trying 127.0.0.1...
* Adding handle: conn: 0x7fada300d000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fada300d000) send_pipe: 1, recv_pipe: 0
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> PUT /empty-file HTTP/1.1