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
#!/usr/bin/env ruby | |
# -*- encoding: utf-8 -*- | |
require 'romankana' | |
require 'appscript' | |
include Appscript | |
kana_pattern = /^[あ-んア-ヴ]+$/u | |
class String |
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
#include <LiquidCrystal.h> | |
int buttonPin = 7; | |
boolean pressedBefore = false; | |
boolean standby = true; | |
// Pin numbers connected to LCD's RS, E, DB4, DB5, DB6 and DB7 | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); |
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
#!/usr/bin/env ruby | |
def bash_source(file) | |
`bash -c "source #{file}"` | |
end | |
# Make sure to use RVM | |
user_rvm = "#{ENV['HOME']}/.rvm/scripts/rvm" | |
system_rvm = "/usr/local/rvm/scripts/rvm" |
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
javascript:(function() { function pad(num) { return ("0" + num.toString()).slice(-2); } $('time').each(function() { var $this = $(this), d = new Date($this.attr('datetime')), str = pad(d.getMonth() + 1) + "/" + pad(d.getDate()) + " " + pad(d.getHours()) + ":" + pad(d.getMinutes()); $this.text(str); }); })(); |
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 'something/to/be/required' | |
class Sinatra::Base | |
@@prepared = nil | |
def self.onion_core | |
onion = prototype | |
loop do | |
onion = onion.instance_variable_get('@app') | |
return onion if onion.class == self || onion.nil? |
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
diff --git a/_config.yml b/_config.yml | |
index 5c7d335..7ad03bb 100644 | |
--- a/_config.yml | |
+++ b/_config.yml | |
@@ -45,7 +45,7 @@ titlecase: true # Converts page and post titles to titlecase | |
# list each of the sidebar modules you want to include, in the order you want them to appear. | |
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html' | |
-default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html] | |
+default_asides: [asides/recent_posts.html, custom/asides/categories.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard. |
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
watch('(.*)\.coffee') { |md| system "coffee -o js -c #{md[0]}" } | |
watch('sass\/(.*)\.s[ac]ss') { |md| system "compass compile #{md[0]}" } |
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
// | |
// Example: | |
// $cat_ID = 12; | |
// wp_get_cat_archives('type=monthly', $cat_ID); | |
// | |
// Borrowed a lot from the following links. | |
// | |
// - http://wordpress.org/support/topic/wp_get_archives-and-conditional-tags | |
// - http://www.stemlegal.com/greenhouse/2012/setting-up-month-archives-to-only-display-custom-taxonomy-wordpress/ | |
// |
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
while [ true ]; do ls -1 foo | wc -l; sleep 1; done |
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
$.fn.headbutt = function (offset) { | |
if (offset == null) { | |
offset = 0; | |
} | |
this.each(function () { | |
var $elem = $(this) | |
, initialTop = $elem.offset().top | |
, initialPosition = $elem.css('position') | |
; | |
$window = $(window).on('scroll', function () { |
OlderNewer