Skip to content

Instantly share code, notes, and snippets.

View aeldaly's full-sized avatar

Ahmed El-Daly aeldaly

  • Brampton, Ontario
View GitHub Profile
# lib/tap.py
"""
tap protocol client.
Copyright (c) 2010 Dustin Sallings <dustin@spy.net>
"""
import socket
import string
aeldaly@disco14:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 458G 3.4G 431G 1% /
none 12G 228K 12G 1% /dev
none 12G 0 12G 0% /dev/shm
none 12G 56K 12G 1% /var/run
none 12G 0 12G 0% /var/lock
none 12G 0 12G 0% /lib/init/rw
none 458G 3.4G 431G 1% /var/lib/ureadahead/debugfs
/dev/sda1 90M 34M 52M 40% /boot
// Staging (rails2), works
{"wine": {
"user_reviews":[],
"public_critic_reviews":[
{
"reviewer_uuid":null,
"notes":"The 2008 Diamandes de Uco Gran Reserva is a blend of 85% Malbec and 15% Cabernet Sauvignon aged in French oak for 20 months. A glass-coating opaque purple/black color, it offers up an impressive nose of mineral, earth notes, licorice, soy, espresso, black cherry, and black currant. Medium-bodied on the palate and surprisingly elegant, it reveals layered, spicy black fruit flavors, excellent concentration and volume, and enough structure to support several more years of cellaring. This lengthy offering will deliver peak drinking from 2013 to 2023. -JM",
"reviewer_name":"Robert Parker",
"get_mobile_app_wine_rating_image":"<img src=\"/images/weighting/4.7.png\" alt=\"92\" title=\"92\" width=\"46\" height=\"46\" /> (92)",
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
text
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --plaintext vagrant
def index
# version 3 or greated supports embedding post comments
if derived_version >= 3
render json: @posts.includes(:comments), serializer: V3::PostSerializer
else
# shared code for all versions
render json: Post.scoped # defaults to PostSerializer
# could also do
@aeldaly
aeldaly / nnpc.sql
Created November 29, 2016 16:09
nnpc setup
\set path '''' `pwd`/NNPC_fixed.csv ''''
CREATE EXTENSION IF NOT EXISTS prefix WITH SCHEMA public;
DROP TABLE IF EXISTS national_destination_codes;
CREATE TABLE national_destination_codes (
id SERIAL,
country character varying(255),
iso3166_3 character varying(3),