Skip to content

Instantly share code, notes, and snippets.

View lululau's full-sized avatar
🎯
Focusing

FCP lululau

🎯
Focusing
  • Sunshine, Mountain East
View GitHub Profile
@lululau
lululau / HelloWorld.java
Created February 24, 2012 17:20
Gist Test
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
@lululau
lululau / test
Created January 22, 2013 15:48
test
~ $ cat test.sh
#!/bin/bash
function hello() {
echo "ARG1: $1"
echo "ARG2: $2"
echo "ARG3: $3"
}
echo "ARG_1: $1"
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# -*- ruby -*-
require 'optparse'
NOW = Time.now
CONTENT_TYPE_MAP = {
"app" => "com.apple.application-bundle",
_autojump()
{
local cur
cur=${COMP_WORDS[*]:1}
comps=$(autojump --bash --complete $cur)
while read i
do
COMPREPLY=("${COMPREPLY[@]}" "${i}")
done <<EOF
$comps
#!/opt/local/bin/python2.7
# -*- coding: utf-8 -*-
"""
Copyright © 2008-2012 Joel Schaerer
Copyright © 2012 William Ting
* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
#!/usr/bin/env python
import sys
import getopt
import re
import types
#
# Originally written by Einar Lielmanis et al.,
# Conversion to python by Einar Lielmanis, einar@jsbeautifier.org,
#!/usr/bin/env perl
my $bounds_string = join "", <>;
$bounds_string =~ s#\{#[#g;
$bounds_string =~ s#\}#]#g;
eval 'our $bounds = ' . $bounds_string;
my %apps = ();
for my $window (@$bounds) {
my $app_name = $window->[0];
my $window_title = $window->[1];
#!/usr/bin/env python
#coding=UTF8
#
# texttable - module for creating simple ASCII tables
# Copyright (C) 2003-2011 Gerome Fournier <jef(at)foutaise.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
@lululau
lululau / pry-cli-parse-options.rb
Created September 4, 2013 17:49
parse_options method in pry/cli.rb
def parse_options(args=ARGV.dup)
unless options
raise NoOptionsError, "No command line options defined! Use Pry::CLI.add_options to add command line options."
end
self.input_args = args
opts = Slop.parse!(args, :help => true, :multiple_switches => false, &options)
# Option processors are optional.
@lululau
lululau / dash-docgen.sh
Last active August 7, 2022 19:50
Add your home page of online docs to Dash.app
#!/bin/bash
if [ $# != 3 ]
then
cat <<EOF
Usage:
dash-docgen <doc name> <default keyword> <url>
EOF
else
DOC_NAME=$1