Skip to content

Instantly share code, notes, and snippets.

View pyk's full-sized avatar
🐈‍⬛
I may be slow to respond.

pyk pyk

🐈‍⬛
I may be slow to respond.
View GitHub Profile
@pyk
pyk / faktorial.py
Created December 22, 2013 01:57
fungsi faktorial.
def faktorial(angka):
if angka <= 1:
return 1
else:
return angka*faktorial(angka-1)
for angka in range(angka,angka+1):
print "%d ! = %d" %(angka, faktorial(angka))
@pyk
pyk / example.rb
Created December 18, 2013 07:28 — forked from britishtea/example.rb
require 'function'
# A fibonacci function.
fib = Function.new
fib[0] = 0
fib[1] = 1
fib[Integer] = proc { |i| fib[i - 2] + fib[i - 1] }
p fib[0] # => 0
@pyk
pyk / .gitconfig
Last active December 27, 2015 10:39
my git configuration file - allways write nice look git commit using sublime text - bunch of usefull git aliases
[core]
excludesfile = /path/to/global/.gitignore
quotepath = false
editor = sublime -w
[user]
name = [your name]
email = [your email]
[mergetool]
/**
* Generates JavaScript version of HTML templates for AngularJS as part of a Grunt build
*
* Allows for bundling into multiple collections, for applications that are distributed across more than one page.
*
* Usage (in grunt.initConfig):
*
* html2js: {
* firstTemplateCollection: {
* src: ['<%= src.first %>'],

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

@pyk
pyk / Makefile
Created August 20, 2013 00:13
my Makefile .
TESTS = test/*/*.js
REPORTER = spec
test:
@NODE_ENV=test ./node_modules/.bin/mocha \
--require should \
--reporter $(REPORTER) \
$(TESTS)
test-docs:
mkdir docs && touch docs/test.html && \
var fs = require('fs');
fs.readFile('./resource.json',function(err, data){
if(err) throw err;
console.log(JSON.parse(data));
});
console.log('Selanjutnya...');
$hasil = mysql_query("SELECT * FROM TabelAnggota");
print_r($hasil);
@pyk
pyk / SublimeLinter.sublime-settings
Created August 2, 2013 22:24
Custom jshint option on sublime linter. remove warn on comma first coding style
{
"jshint_options":
{
// remove warning on comma first coding style
"laxcomma":true
}
}
@pyk
pyk / less.sublime-build
Created July 29, 2013 22:47
sublime build [Errno 2] No such file or directory for LESS. already fixed. see on https://gist.github.com/peeyek/6108287 for jade
{
"cmd": ["lessc", "--compress", "$file", "../$file_base_name.css"],
"selector": "source.jade",
"path": "/usr/local/bin"
}
# path is where your jade executable.
# type in terminal :
# $ which jade
# and change into "path" value into your location.