fdisk /dev/mmcblk0
# Delete the second partition /dev/mmcblk0p2
d
2
# Create a new primary partition and use default sizes prompted. This will then create a partition that fills the disk
n
p
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 | |
require 'rubygems' | |
require 'rb-fsevent' | |
cmd, *paths = ARGV | |
if cmd && paths.any? | |
system cmd | |
fsevent = FSEvent.new | |
fsevent.watch(paths) { system cmd } | |
fsevent.run |
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
data = { | |
"section1.stuff"=>"as", | |
"section1.stuff2" => "qw", | |
"section2.stuff3" => "zx" | |
} | |
hash = Hash.new(&(p=lambda{|h,k|h[k]=Hash.new(&p)})) | |
data.each_with_object(hash) { |(k,v), h| | |
eval "h['#{k.gsub('.',"']['")}']='#{v}'" |
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
package main | |
import ( | |
"io" | |
"fmt" | |
"time" | |
"net/http" | |
"encoding/json" | |
"github.com/bmizerany/pat" | |
"github.com/garyburd/redigo/redis" |
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 'open-uri' | |
require 'nokogiri' | |
module BarCampStockholm | |
class << self | |
def url | |
'http://barcampstockholm.com/' | |
end |
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 'open-uri' | |
require 'nokogiri' | |
module YCList | |
class << self | |
def url | |
'http://yclist.com/' | |
end |
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
# | |
# MIT License - (c) 2011 John Mettraux | |
# | |
# Slightly modified - 2013 Peter Hellberg | |
# | |
require 'parslet' | |
module MyJSON | |
class Parser < Parslet::Parser |
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
Shoes.app do | |
border "#FF6600", strokewidth: 6 | |
background "#FF6600".."#CC0000" | |
fill rgb(255,102,0, 0.5) | |
stroke rgb(255,102,0, 0.9) | |
strokewidth 0.25 | |
ovals = 40.times.map do |
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 'open-uri' | |
require 'nokogiri' | |
url = 'http://www.riotminds.se/drakar-och-demoner/tiden-innan-trudvang/' | |
doc = Nokogiri::HTML(open(url)) | |
doc.css('#content .column_left a').map do |a| | |
title = a.css("img").first.attributes["title"] | |
href = a.attributes["href"].to_s | |
cmd = "curl -L #{href} -o \"/tmp/#{title}.pdf\"" |
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 'dino' | |
# Slightly nicer interface to the Arduino :) | |
module Dino | |
class << self | |
def board | |
@board ||= Board.new TxRx.new | |
end | |
def method_missing(m, pin) |