Skip to content

Instantly share code, notes, and snippets.

@tafarij
tafarij / install-pulse.sh
Created April 22, 2017 13:05
Install Pulse Secure on Ubuntu 16.04
# https://vt4help.service-now.com/kb_view_customer.do?sysparm_article=KB0010740#linux
wget https://secure.nis.vt.edu/resources/downloads/pulse-8.2R5.i386.deb
sudo dpkg –i pulse-8.2R5.i386.deb
/usr/local/pulse/PulseClient.sh install_dependency_packages
@vgvinay2
vgvinay2 / soundex.js
Created November 21, 2016 09:19 — forked from shawndumas/soundex.js
Soundex in JavaScript
var soundex = function (s) {
var a = s.toLowerCase().split(''),
f = a.shift(),
r = '',
codes = {
a: '', e: '', i: '', o: '', u: '',
b: 1, f: 1, p: 1, v: 1,
c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2,
d: 3, t: 3,
l: 4,
@jamesyang124
jamesyang124 / security_algorithms.md
Last active August 22, 2016 15:46
security algorithms for refactoring.
@vgvinay2
vgvinay2 / gist:36ab54d95472ef0b057b
Created January 29, 2016 17:40 — forked from bkimble/gist:1365005
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@Godoy
Godoy / Steps.md
Last active June 20, 2017 21:38
deploy ruby on rails 4 with capistrano nginx unicorn - ubuntu 14.04

Steps

These steps were made with Ubuntu 14.04 e ruby 2.3.1. To enjoy the ease of step-by-step, I suggest not change folders and application name - just change the server ip and git

Create user to deploy

# Server console
sudo adduser deployer
sudo gpasswd -a deployer sudo
@artificemm
artificemm / titleize_fields
Created May 24, 2015 05:38
I hate UPCASE data on the DB, so I made this to prevent it
#I hate UPCASE data on the DB, so I made this to prevent it
before_save :titleize_fields
def titleize_fields
['name', 'paternal_lastname', 'maternal_lastname', 'spouse'].each do |m|
self.send("#{m}=", instance_eval(%Q{#{m}.titleize unless #{m}.nil?}))
end
end
@mupkoo
mupkoo / facebook.coffee
Last active March 15, 2018 18:26
Facebook Like snippet for Turbolinks
class @Facebook
rootElement = null
eventsBound = false
@load: ->
unless $('#fb-root').size() > 0
initialRoot = $('<div>').attr('id', 'fb-root')
$('body').prepend initialRoot
module A
def do_something
puts 'A->do_something'
super
end
end
module B
def do_something
puts 'B->do_something'
@rietta
rietta / plpgsql.rake
Last active August 8, 2020 15:05
Are you using PostgreSQL and don't want to make your app run as PostgreSQL super user, then add this custom rake task to your `lib/tasks` folder and be happy.
#
# PostgreSQL writes two optional commands to the database schema
# file, called db/structure.sql, that can only be run as a root
# database user. These are not needed actually, so comment them
# out automatically
#
# CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
# COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
#
namespace :db do
@zacksiri
zacksiri / app_name
Created November 25, 2013 07:49
nginx config
upstream unicorn {
server unix:/tmp/unicorn.app_name.sock fail_timeout=0;
}
server {
server_name domain.com www.domain.com;
listen 80 default deferred;
root /opt/apps/app_path/public;