Skip to content

Instantly share code, notes, and snippets.

@gbluma
gbluma / behavior.php
Created December 18, 2010 06:26
joomla16_install/libraries/joomla/html/behavior.php
<?php
/**
* @version $Id: behavior.php 19659 2010-11-27 17:10:56Z chdemko $
* @package Joomla.Framework
* @subpackage HTML
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
@gbluma
gbluma / gist:801089
Created January 28, 2011 22:01
vimrc
syntax on
filetype on
colorscheme desert
set gfn=Consolas:h10:cANSI
set title
set backspace=start,indent,eol
set number
set smartindent
set autoindent
@gbluma
gbluma / gist:841253
Created February 23, 2011 21:46
FizzBuzz.fsx
// ----------------------------------------------------------------------
// Synchronous (useful)
let fizzbuzz n =
match n with
| n when (n % 3 = 0) -> printfn "Fizz"
| n when (n % 5 = 0) -> printfn "Buzz"
| n -> printfn "%d" n
[1..100] |> Seq.iter (fun n -> fizzbuzz n)
@gbluma
gbluma / hiphop-build.sh
Created April 27, 2011 18:17 — forked from sibprogrammer/hiphop-build.sh
Script for building HipHop for PHP at Ubuntu 9.10 32-bit
#!/bin/sh
sudo apt-get install cmake g++ libboost-dev flex bison re2c libmysqlclient-dev \
libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev \
libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev git-core \
autoconf libtool libcurl4-openssl-dev libboost-system-dev \
libboost-program-options-dev libboost-filesystem-dev curl
# getting hiphop source code
mkdir hiphop
@gbluma
gbluma / .screenrc
Created October 28, 2011 20:22
Basic configuration for GNU Screen
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"
# show status bar
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
# don't display the copyright page
@gbluma
gbluma / search.hs
Created December 16, 2011 19:14
Simple Haskell Autocomplete
import Data.List
import Data.List.Utils
import Data.Function
main = do
contents <- readFile "BingBodyJun09_Top100KWords.txt"
-- break into lines
# 1. Install Lua 5.1
# 2. Install Luarocks
# 3. Follow these instructions
# go some place safe
cd /tmp
# become root (watch out!)
sudo bash
@gbluma
gbluma / tcp.hs
Created February 21, 2012 18:50
Really basic web server
import Network (listenOn, withSocketsDo, accept, PortID(..), Socket)
import System (getArgs)
import System.IO (hSetBuffering, hGetLine, hPutStrLn, BufferMode(..), Handle, hClose)
import Control.Concurrent (forkIO)
main :: IO ()
main = withSocketsDo $ do
args <- getArgs
let port = fromIntegral (read $ head args :: Int)
sock <- listenOn $ PortNumber port
-- F#-style pipe for nicer readability of programs.
-- Instead of writing function calls in a nested form, you can accomplish the same thing
-- and read it in a straightforward order.
-- define the pipe
(|>) x y = y x
-- example usage
main = do
@gbluma
gbluma / conflict-detector.sh
Created May 17, 2012 04:17
Find conflicts between two directories
#!/bin/bash
set -e
function find_conflicts {
# verify that BASE, ROOT, COMPARISONS are set
# ...
# generate a timestamp
thedate=$(date +"%F_%X" | sed "s/:/-/g")