Skip to content

Instantly share code, notes, and snippets.

@0xGGGGG
0xGGGGG / pgsql_workflow.sh
Last active January 21, 2016 13:28
postgres install and develop applications on MAC OSX with rails
# first install pgsql with home brew
brew install postgresql
# at this point, you need to be sure you have /usr/local/bin before /usr/bin on your $PATH
# to see, run:
brew doctor
# if doctor does not complain about this issue you can pass this step.
# prepend /usr/local/bin to your PATH in your ~/.bash_profile
@0xGGGGG
0xGGGGG / nginx_build_premature.rb
Created January 1, 2013 00:17
nginx-premature-build
nginx_version = "1.2.6"
download_url = "http://nginx.org/download/nginx-#{nginx_version}.tar.gz"
file_path = "#{Chef::Config[:file_cache_path]}/nginx-#{nginx_version}.tar.gz"
remote_file file_path do
owner "root"
group "root"
mode 00644
#!/bin/bash -xe
#THIS SCRIPT MUST BE RUN AS ROOT
#configure SSH
SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuwaDITgrsmxVvSJ+HEir4iW2eBb8XqB3wIxCWJwmhiB2S6MkdX1CFcj8boHL2RIYgKN0yiTCVlOdQFjhyRpnd8NbS0RW7753SE1hzkgOg+2e1B15lf1PCSD5OPWAtpb1eYlLcs6hns+yFhYCFeQrKLBL2/si8D8OcQcTR7BjjFQEWdhjl4cYiT68cr57yFT+c/f32ZTynEWukC2YIGMjJ1nACUOYF8CSp6RUrD2kY3C1Pb1Q5V3jwi0lhay4aF5AWp28hPVtYASBe2BrYXp8uErhnmWxgXNV19P0NSHE7TBXd9nXz/njI2SDP/p2N/vHquz/Ybxs4F+kGGXknUFitQ== [email protected]"
echo $SSH_KEY >> /home/ubuntu/.ssh/authorized_keys
#configure locale
echo "export LANGUAGE=en_AU.UTF-8" > /tmp/locale
@0xGGGGG
0xGGGGG / app.js
Created November 22, 2012 14:26 — forked from dbainbridge/app.js
How to use socket.io with Express 3
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http');
var app = express();
var server = app.listen(3000);
@0xGGGGG
0xGGGGG / photo_fetcher.rb
Created September 12, 2012 12:14
scrabing photos from movie catalog site
require "rubygems"
require "mechanize"
require "cgi"
require "csv"
require 'digest/sha1'
require "image_downloader"
class PhotoFetcher
@0xGGGGG
0xGGGGG / data_parser.rb
Created September 11, 2012 20:32
simple script to scrabe hurriyet's posts
require "rubygems"
require "mechanize"
require "cgi"
require "csv"
require "active_record"
require "./lib/colorize_output"
@0xGGGGG
0xGGGGG / my_behaviour.erl
Created July 3, 2012 21:53
implementing a custom behavior you want
-module(my_behaviour).
-export([behaviour_info/1]).
%% init/1, some_fun/0 and other/3 are now expected callbacks
behaviour_info(callbacks) -> [{init,1}, {some_fun, 0}, {other, 3}];
behaviour_info(_) -> undefined.
@0xGGGGG
0xGGGGG / Emakefile
Created July 3, 2012 16:42
a classic erlang make file with a structural project.
% compile it with 'erlc -make'
% then start shell with 'erl -pa ebin/'
{
'src/*',
[
debug_info,
{ i, "src" },
{ i, "include" },
{ outdir, "ebin" }
@0xGGGGG
0xGGGGG / binary_tree.erl
Created June 27, 2012 15:55
creating a basic functional programmed bst implementation
% Module: binary_tree
% Exposes new binary tree syntax.
%
% Author: monkegjinni <[email protected]>
%
% Notices:
% !These is a very naive tree implementation. In Production do not use this.
% For more efficient and product ready tree implementation; you should check
% otp_src_R<version>B<revision>/lib/stdlib/src/gb_trees.erl .
%
@0xGGGGG
0xGGGGG / monkegjinni.sublime-settings
Created June 27, 2012 14:20
user preferences of sublime text 2 for my taste (:
{
"color_scheme": "Packages/Railscasts.tmTheme",
"font_size": 14.0,
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,