Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
@rippinrobr
rippinrobr / core.clj
Created March 25, 2011 20:42
The first hello clojure web service file.
(ns hello-clojure-web.core
(:use ring.adapter.jetty))
(defn handler [req]
{:status 200
:headers {"Content-Type" "text/html"}
:body "Hello Clojure Web!" })
(run-jetty handler {:port 8080})
@marc0der
marc0der / Grails on Ubuntu
Created April 4, 2011 16:07
Install Grails on Ubuntu through LaunchPad
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails-ppa
#to add grails 2.0.x
sudo apt-get install grails 2.0.x
#to add grails 1.3.9
sudo apt-get install grails-1.3.9
@stungeye
stungeye / vim.md
Last active June 21, 2018 15:32
Improving my VIM

Setting up Pathogen

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Ensure that pathogen.vim ends up in ~/.vim/autoload

Colour Scheme

mkdir ~/.vim/colors

@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@rednaxelafx
rednaxelafx / Notes
Created May 29, 2011 20:47
Example of HotSpot's PrintCompressedOopsMode's output. It's clear that UseCompressedOops can only be used with heap size < 32GB
The "size" field shows total reserved GC heap size in MB, which includes all generations (including PermGen).
"32-bits Oops" means the shift is zero; otherwise it'd be non-zero.
If UseCompressedOops is false, or if the heap is too big to use compressed oops, then PrintCompressedOopsMode won't print anything. The -Xmx32g example below show that ergonomics didn't set UseCompressedOops to true.
If the heap is too big, HotSpot would print a warning message and set UseCompressedOops to false.
@andialbrecht
andialbrecht / git-branch-io
Created May 31, 2011 08:06
git command to summarize incoming and outgoing changes on local branches
#!/usr/bin/env python2
# git-branch-io -- show incoming and outgoing commits
#
# Place this file somewhere in your PATH.
#
# Usage: git branch-io [branch]
#
# If branch is not given the current branch will be used. The script
# prints out how many commits should go in either direction to bring
@lukas-vlcek
lukas-vlcek / gist:1012051
Created June 7, 2011 11:18
Full search query #BBUZZ 2011
{
"from" : 0,
"query" : {
"filtered" : { "query" : { "query_string" : { "query" : "jboss server" } },
"filter": {
"and" : [
{"range" : { "date" : {"from":"2007-07-25","to":"2010-12-16"}}},
{"terms" : { "_index" : ["weld"]}},
{"terms" : {"mail_list" : ["dev"]}},
{"terms" : {"from.not_analyzed" : [ "Galder Zamarreno <galder.zamarreno@redhat.com>","Pete Muir <pmuir@redhat.com>"]}}
@chapmanb
chapmanb / vagrant_pallet.clj
Created June 20, 2011 11:26
Running pallet with manual specification of a server; example with vagrant virtualbox
(ns distblast-cluster.vagrant
(:require [pallet.compute :as compute]
[pallet.phase :as phase]
[pallet.core :as core]
[pallet.utils :as utils]
[pallet.compute.node-list :as node-list]
[pallet.action.exec-script :as exec-script]))
(defn test-script [session]
(-> session
@cjus
cjus / jsonval.sh
Created June 26, 2011 17:42
Extract a JSON value from a BASH script
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#