Skip to content

Instantly share code, notes, and snippets.

View xinuc's full-sized avatar
💭
I may be slow to respond.

Nugroho Herucahyono xinuc

💭
I may be slow to respond.
View GitHub Profile
xmonad.hs:33:14:
Couldn't match expected type `XConfig l0'
with actual type `xmonad-0.9.2:XMonad.Core.XConfig a0'
In the second argument of `($)', namely
`defaultConfig
{manageHook = manageDocks <+> manageHook defaultConfig,
layoutHook = avoidStruts $ layoutHook defaultConfig,
normalBorderColor = "#7c7c7c", focusedBorderColor = "#ffff00",
startupHook = setWMName "LG3D", keys = myKeys, borderWidth = 3,
terminal = "terminator"}
# use colon syntax for your hashes
# ruby colonize.rb old_ruby_file.rb > new_ruby_file.rb
code = File.read ARGV[0]
code.scan(/\:(\S+?) =>/).each{|a| code.sub!(/:#{a.first} =>/, "#{a.first}:")}
puts code
(doseq
[time (range now infinity)]
(loving you))
@xinuc
xinuc / gist:913110
Created April 11, 2011 05:40
stupid simple password generator
require 'digest/sha1'
master_password = ARGV[0]
domain = ARGV[1]
digest = Digest::SHA1.hexdigest(master_password + domain)
digest =~ /([^\d])/
puts digest.sub($1, $1.upcase)
@xinuc
xinuc / Array.java
Created January 20, 2011 09:55
generated java
// Generated from array.mirah
public class Array extends java.lang.Object {
private static java.util.List ary;
public static void main(java.lang.String[] argv) {
java.util.Iterator __xform_tmp_1 = null;
java.lang.Object a = null;
Array.ary = java.util.Collections.unmodifiableList(java.util.Arrays.asList(1, 2, 3, 4, 5, 6));
__xform_tmp_1 = Array.ary.iterator();
label1:
while (__xform_tmp_1.hasNext()) {
@xinuc
xinuc / gist:657813
Created November 1, 2010 08:17
palindrom in haskell
palindrom [] = True -- empty string
palindrom [_] = True -- a character
palindrom xs = (x == y) && (palindrom middle)
where x = head xs
y = last xs
middle = init (tail xs)
╭─[~/sandbox]➜[xinuc@xinuc-laptop]➜[10006]
╰─(☹) ✘ git clone http://github.com/karthick18/inception.git
Initialized empty Git repository in /home/xinuc/sandbox/inception/.git/
remote: Counting objects: 64, done.
remote: Compressing objects: 100% (64/64), done.
remote: Total 64 (delta 32), reused 0 (delta 0)
Unpacking objects: 100% (64/64), done.
╭─[~/sandbox]➜[xinuc@xinuc-laptop]➜[10007]
╰─(☺) ✘ cd inception
╭─[~/sandbox/inception]➜[xinuc@xinuc-laptop]➜[10008]➜ git:(master) Φ
I was a little boy of 9 years old
The whole world in my hands
Trying to toss that ball across the yard
A game of catch with my old man
He would always say I’m sorry
Every time he had to leave
And I was much too young to understand
When he would say to me
Lord, I got to ask a favor
And I'll hope You'll understand
'Cause I've lived life to the fullest
Let this boy die like a man
return true if authorizable_obj.respond_to?(role_name) && (authorizable_obj.send(role_name) == self)