Skip to content

Instantly share code, notes, and snippets.

View cadrev's full-sized avatar

Felan Carlo Garcia cadrev

View GitHub Profile
@cadrev
cadrev / gist:10506216e36777d3bfdf
Last active September 19, 2015 07:38 — forked from codinguncut/gist:c4359d9bc6f36549b625
kaggle collection
  1. feature engineering (most important by far)!!!!!
  2. simple models
  3. overfitting leaderboard
  4. ensembling
  • predict the right thing!
  • build pipeline and put something on the leaderboard
  • allocate time to play with data, explore
  • make heavy use of forums
  • understand subtleties of algos, know what tool to use when
@cadrev
cadrev / ram usage.txt
Created September 16, 2015 11:48
Find the top memory users in Ubuntu
ps -e -o pid,vsz,comm= | sort -n -k 2

Exercise 1: Leap Year

# Get input from user
year = raw_input('Enter year: ')
year = int(year)
# Calculate leap year
if ((year % 4 == 0) and (year%100 != 0)) or (year % 400 == 0):
  print "Yes"
else:
server {
listen 80;
server_name 202.90.159.201;
#charset koi8-r;
#access_log logs/host.access.log main;
# Load configuration files for the default server block.
@cadrev
cadrev / find a port and kill it
Created July 23, 2015 03:12
find-and-kill-a-process-in-one-line-using-bash-and-regex
PORT_NUMBER=1234
lsof -i tcp:${PORT_NUMBER} | awk 'NR!=1 {print $2}' | xargs kill
@cadrev
cadrev / psql.md
Last active August 29, 2015 14:25 — forked from schaternik/pg_hba.conf
Postgresql

PSQL -- PostgreSQL interactive terminal

sudo -u postgres psql -> postgres=#

CREATE DATABASE test_database;

CREATE USER test_user WITH password 'qwerty';

GRANT ALL privileges ON DATABASE test_database TO test_user;

@cadrev
cadrev / timestap-basics.py
Created July 20, 2015 03:23
python timestamp snippet
import time
timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
print timestamp
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.