Skip to content

Instantly share code, notes, and snippets.

alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@davelnewton
davelnewton / infoq.sh
Last active August 29, 2015 14:06 — forked from shirishp/infoq.sh
#! /bin/bash
# Author: Shirish Padalkar (https://twitter.com/_Garbage_)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 infoq_presentation_url"
exit 1
fi
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
#! /bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 infoq_presentation_url"
exit 1
fi
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
url=${url_with_spaces//<source src=/}
@davelnewton
davelnewton / 01_jquery_version_01.js
Last active August 29, 2015 14:10
Why AngularJS* Will Succeed
$(function() {
$('#trigger').on('click', function(e) {
e.preventDefault();
$.ajax({
url: '/books/1/simpleDom',
success: function (data) {
$('#target').html(data);
},
fail: function (data) {
@davelnewton
davelnewton / 00_see_blog_post.text
Last active August 29, 2015 14:22
CoffeeScript IIFEs
For the blog post at:
http://buckybits.blogspot.com/2015/06/coffeescript-iifes.html
@davelnewton
davelnewton / gist:5d66db2b9d7b594e8212
Created July 11, 2015 19:56
Can't Dupe Date Issue
> yesterday = DateTime.yesterday()
=> Fri, 10 Jul 2015
> yesterday.beginning_of_week
=> Sun, 05 Jul 2015
> (yesterday.beginning_of_week - 1.days).beginning_of_week
=> Sun, 28 Jun 2015
@davelnewton
davelnewton / 01-styles.less
Created August 5, 2015 20:55
Change UI element font size
@atom-ui-font-size: 10px;
html, body, .tree-view, .status-bar, .tab-bar .tab {
font-size: @atom-ui-font-size;
}
@davelnewton
davelnewton / Main.java
Created September 8, 2011 23:32
Basic Java stuff
package ClassFiles;
public class Main {
public static void main(String[] args) {
System.out.println("Wat");
}
}
@davelnewton
davelnewton / timers.html
Created September 9, 2011 02:53
Speedy
<html>
<head>
<script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js">
</script>
</head>
<body>
Speed: <span id="speed"></span>
</body>
@davelnewton
davelnewton / gist:1205973
Created September 9, 2011 11:17
beautifuller
return false if real_account.nil?
date = date_from_str('2011-01-01')
return true if payments.has_finished? && real_account.created_before? date
Trade.has_payments(real_account.login, date)