Skip to content

Instantly share code, notes, and snippets.

View makenai's full-sized avatar

Pawel Szymczykowski makenai

  • Codingscape
  • Nagoya, JP
View GitHub Profile
#!/usr/bin/ruby
require 'tmpdir'
tmpdir = File.join( Dir.tmpdir, 'ipaToEpub' )
Dir.mkdir( tmpdir ) unless File.directory?( tmpdir )
if !File.directory?( tmpdir )
puts "Error - cannot create temporary directory '#{tmpdir}'!"
exit
end
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import urlfetch
import pprint
class MainHandler(webapp.RequestHandler):
def get(self,path):
pp = pprint.PrettyPrinter(indent=4)
request_url = 'http://api.zappos.com/' + path + '?' + self.request.query_string
response = urlfetch.fetch( request_url )
@makenai
makenai / gist:1104664
Created July 25, 2011 17:35
Menu Layout
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_ztv_channels"
android:title="Channels"
android:showAsAction="always" />
<item android:id="@+id/menu_search"
android:title="Search"
android:showAsAction="always"
android:actionViewClass="android.widget.SearchView" />
@makenai
makenai / label.rb
Created October 14, 2011 14:56
Fuzzy QR code
require 'rubygems'
require 'rghost'
require 'rghost_barcode'
RGhost::Config::GS[:path] = '/usr/local/bin/gs'
RGhost::Config::GS[:unit] = RGhost::Units::Inch
doc = RGhost::Document.new :paper => [3,2] # 3"x2" label
doc.barcode_code39( '1234567', :x => 0.45, :y => 0.125, :width => 1.75, :height => 0.35, :rotate => 90 )
doc.barcode_qrcode('http://usrlib.org/media/1234567', :x => 1, :y => 0.125, :eclevel => 'H', :width => 1.5, :height => 1.5 )
@makenai
makenai / gist:1294621
Created October 18, 2011 04:42
Halloween Playlist
Warren Zevon – Werewolves Of London
Bobby "Boris" Pickett – Monster Mash
Oingo Boingo – Weird Science
Sheb Wooley – The Purple People Eater
DJ Jazzy Jeff & The Fresh Prince – A Nightmare On My Street
The Philadelphia Orchestra – A Night on Bald Mountain
Bow Wow Wow – I Want Candy
Michael Jackson – Thriller
Marilyn Manson – This Is Halloween
The Citizens of Halloween – This Is Halloween
#!/usr/bin/env ruby
repo = `basename \`git rev-parse --show-toplevel\``.strip
sha = `git rev-parse HEAD`.strip
file= "~/Dropbox/Code/gitshots/#{Time.now.to_i}-#{repo}-#{sha}.jpg"
puts "Taking capture into #{file}!";
system "imagesnap -q -w 3 #{file} &";
exit 0

Keybase proof

I hereby claim:

  • I am makenai on github.
  • I am makenai (https://keybase.io/makenai) on keybase.
  • I have a public key whose fingerprint is 4763 E36E D280 F445 0858 0ACC 166E 87EF AE5C F8A9

To claim this, I am signing this object:

@makenai
makenai / gist:74cf1a8937220c70c3a8
Last active August 29, 2015 14:01
Mapping Things
<!DOCTYPE html>
<html>
<head>
<title>Leaflet mobile example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
WallThickness = 2;
BallSize = 15.75;
Airgap = .5;
Mount = 3;
TotalHeight = 19.5;
MountScrewRad = 2; //3mm screw
BallProtrude = .33; //percentage of ball radius sticking out
MountType = 1; //1=ears 2=center screw
ScrewSpacing = 25;
var five = require("johnny-five");
var Spark = require("spark-io");
var keypress = require('keypress');
var board = new five.Board({
io: new Spark({
token: "{YOURS}",
deviceId: "{YOURS}"
})
});