Skip to content

Instantly share code, notes, and snippets.

View onsails's full-sized avatar
You only truly know it when you truly feel it

Andrey Kuznetsov onsails

You only truly know it when you truly feel it
View GitHub Profile
# :%s/%appname%/_appname_/g
# :%s/%appname%/_username_/g
# :%s/%domain%/_domain_/g
set :application, "%appname%"
set :repository, "git@github.com:smix/%appname%.git"
set :deploy_to, "/var/rails/%appname%"
set :deploy_via, :remote_cache
set :branch, 'master'
set :scm, :git
@casualjim
casualjim / lift_mongo_specification.scala
Created August 25, 2011 19:49
A versioning trait for lift-mongodb-record models with rogue
package mojolly
package mongo
package tests
import org.specs2.Specification
import org.specs2.specification.{ Step, Fragments }
import net.liftweb.mongodb._
import mongo.MongoConfig.MongoConfiguration
trait LiftMongoDbSpecification extends Specification {
@cedricwalter
cedricwalter / example
Created January 18, 2012 21:52
Nginx configuration for JIRA, TeamCity, Nexus or any other Tomcat web application
## Server configuration for nginx to host Atlassian Jira / Jetbrain TeamCity or any other Tomcat web application
#
# author cedric.walter, www.waltercedric.com
# to be saved for ex in /etc/nginx/sites-available/example
server {
listen 80;
server_name jira.example.com;
access_log off;
location / {
@cee-dub
cee-dub / postgres_timestamp_defaults.rb
Created January 29, 2012 20:53
Convenient methods to let PostgresQL manage created/updated_at
require 'active_support/core_ext/string/filters'
module PostgresTimestampDefaults
def add_timestamp_defaults(table_name)
add_default_now(table_name, :created_at)
add_default_now(table_name, :updated_at)
add_updated_at_trigger(table_name)
end
def add_default_now(table_name, column_name)
@axelpale
axelpale / combinations.js
Last active July 7, 2023 10:37
JavaScript functions to calculate combinations of elements in Array.
/**
* Copyright 2012 Akseli Palén.
* Created 2012-07-15.
* Licensed under the MIT license.
*
* <license>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
@bjornharrtell
bjornharrtell / proguard.cfg
Created August 9, 2012 20:58
Proguard config for akka including akka remote (tested with akka 2.0.2)
-dontwarn org.jboss.netty.logging.**
-dontwarn org.osgi.**
-dontwarn javax.servlet.**
-dontwarn org.jboss.netty.channel.socket.http.**
## Unsafe is there at runtime
-dontwarn sun.misc.Unsafe
-keep class sun.misc.Unsafe{
*;
}
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 14, 2024 11:33
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@sandfox
sandfox / README.md
Created September 15, 2012 23:01
Quick and dirty instructions for building nginx with rtmp support

#Compiling Nginx with RTMP module

  1. Install the following packages sudo apt-get install python-software-properties dpkg-dev git
  2. Add Nginx repo sudo add-apt-repository ppa:nginx/stable
  3. Update package list sudo apt-get update
  4. Get nginx source (put this in it's own dir like /build sudo apt-get source nginx-full
@mikeyk
mikeyk / watch_wal-e.py
Created January 16, 2013 20:24
Watch_wal-e script
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
@CMCDragonkai
CMCDragonkai / Autolink.Filter.js
Created August 18, 2013 20:14
JS: AngularJS Autolinking Filter. Adapted from: http://jsfiddle.net/bmleite/FyGen/