Skip to content

Instantly share code, notes, and snippets.

@nertzy
nertzy / README
Created December 9, 2012 22:32 — forked from symposion/README
Convert OS X Keychain exported entries into logins for 1Password import
These two files should help you to import passwords from mac OS X keychains to 1password.
Assumptions:
1) You have some experience with scripting/are a power-user. These scripts worked for me
but they haven't been extensively tested and if they don't work, you're on your own!
Please read this whole document before starting this process. If any of it seems
incomprehensible/frightening/over your head please do not use these scripts. You will
probably do something Very Bad and I wouldn't want that.
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they
@hugovk
hugovk / helsinki_metro_stations.csv
Last active March 9, 2016 20:04
Helsinki metro stations, co-ordinates taken from Wikipedia.
Latitude Longitude Name
60.163056 24.914444 Ruoholahti
60.168889 24.931944 Kamppi
60.170556 24.940556 Rautatientori
60.172222 24.9475 Helsingin yliopisto
60.18 24.950556 Hakaniemi
60.1875 24.961111 Sörnäinen
60.1875 24.976944 Kalasatama
60.188889 25.008056 Kulosaari
60.195 25.030833 Herttoniemi
@cloudwalking
cloudwalking / new_bashrc.sh
Created August 11, 2012 08:41 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
@dieseltravis
dieseltravis / cs.bat
Created June 29, 2012 14:51
compile and run small blocks of C# in the command-line
@echo off
:: see if %1 exists, if not check for %1.cs
set CODE=%1
IF NOT EXIST %CODE% set CODE=%1.cs
:: init paths
set NETPATH=%systemroot%\Microsoft.NET\Framework64\v4.0.30319
set TEMP_CS=%temp%\~temp.%random%.cs
set TEMP_EXE=%temp%\~temp.%random%.exe
:: init source class
echo using System; class P { static void Main() { > %TEMP_CS%
@aiwilliams
aiwilliams / README.md
Created May 16, 2012 13:52
Storyboard in RubyMotion 1.4

Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's resources directory. Add a UIViewController, and set it's identifier property to "Start". Add some UI elements so you can see it working.

When you run rake in your RubyMotion project, it will compile the .storyboard file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.

anonymous
anonymous / gist:2523336
Created April 29, 2012 02:01
Changing author info
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
@wtaysom
wtaysom / methodfinder_what.rb
Created December 19, 2011 10:48
_why's Ruby MethodFinder addition tweaked and revised.
require 'methodfinder'
# _why's MethodFinder addition tweaked and revised.
# <http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html>
class MethodFinder
def self.with_redirected_streams
redirect_streams
yield
ensure
module Compass::SassExtensions::Functions::GradientSupport
module Functions
def linear_gradient_hm_header(color)
stop1 = Sass::Script::Number.new(45, ["%"])
stop2 = Sass::Script::Number.new(50, ["%"])
cstops = color_stops(
hmBoxHdrGrad1(color),
ColorStop.new(hmBoxHdrGrad2(color), stop1),
ColorStop.new(color, stop2),
@pvinis
pvinis / face_detector.rb
Created December 7, 2011 12:06
run with "macruby face_detector.rb" or "macruby face_detector.rb https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/304055_10150415385415891_522505890_10347873_1682210515_n.jpg?dl=1" for a photo of me with woody and buzz lightyear :p
framework 'Cocoa'
class NSColor
def toCGColor
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace)
## approach #1
# components = Array.new(4){Pointer.new(:double)}
# color_RGB.getRed(components[0],
# green: components[1],
# blue: components[2],
#!/usr/bin/env ruby-local-exec
require 'rubygems'
require 'active_support'
require 'active_support/core_ext'
class Foo
def self.bar
'bar'