Skip to content

Instantly share code, notes, and snippets.

View radzhome's full-sized avatar

Rad W radzhome

  • Postmedia
  • Ottawa
View GitHub Profile
@radzhome
radzhome / Process CSV File Python
Last active August 29, 2015 14:13
First Gist: Process a CSV File in Python/Django
#Test Gist
import csv
from models import RegistrationCode
REQUIRED_FIELDNAMES = frozenset([
'Registration code',
])
@radzhome
radzhome / index.html
Last active August 29, 2015 14:15 — forked from jshaw/index.html
<!DOCTYPE html>
<html>
<head>
<title>Custom Street View panorama tiles</title>
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
#pragma runopts (xplink(on))
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cctype>
#include <string>
#include <sys/stat.h> //use with struct stat attrib;
#include <unistd.h> //stat("afile.txt", &attrib);
#include <time.h> //clock = gmtime(&(attrib.st_mtime));
#include <stdio.h>
/* rexx */
/* LMP KEY Duplicates Summary*/
/* August 2008, functional comparisons working */
/* Input file has to be unnummed, use unnum on file before running */
/*******************************
/* SAME PROD CODE AND xxx! */
/*******************************
INDSN="PS0601.CACOMMON.ALL.PPOPTION(KEYS)"
CALL Initialize
/* REXX */
/* To connect a certificate to keyrings same was as another */
/* certificate, pretty much duplicate its keyring usage as */
/* that of an existing Nov 2010 */
/*outtrap racdcert site and ca output*/
/* Your label will be located from the below query so make sure it */
/* contains what you need!*/
x = OUTTRAP('strRacfLs.')
Address TSO 'RACDCERT SITE LIST'
@radzhome
radzhome / elevator.py
Created July 25, 2015 17:25
An elevator sim, next steps add multiple elevators, use rabbitmq?
"""single elevator shaft simulation, so queues are all in 1 elevator """
import time
import random
AVAILABLE_FLOORS = [-1, 0, 1, 2, 3, 4, 5, 6, 7] # 0 = basement 1 (B1), -1 = B2
FIRST_FLOOR = AVAILABLE_FLOORS[0]
LAST_FLOOR = AVAILABLE_FLOORS[-1]
AVAILABLE_DIRECTIONS = ['up', 'down']
# Nicely titled country names.
COUNTRIES = (
('AF', u'Afghanistan'),
('AX', u'\xc5land Islands'),
('AL', u'Albania'),
('DZ', u'Algeria'),
('AS', u'American Samoa'),
('AD', u'Andorra'),
('AO', u'Angola'),
('AI', u'Anguilla'),
# Nicely titled province and state names
STATES_PROVINCES = (
('AL', u'Alabama'),
('AK', u'Alaska'),
('AS', u'American Samoa'),
('AZ', u'Arizona'),
('AR', u'Arkansas'),
('CA', u'California'),
('CO', u'Colorado'),
('CT', u'Connecticut'),
@radzhome
radzhome / Color Boxes JS
Created March 25, 2016 19:43
Color Boxes JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>P1</title>
<style type="text/css">
.grid-box {
width: 100px;
height: 100px;
border: 1px solid #000;
@radzhome
radzhome / N by N Grid JS
Created March 25, 2016 19:44
N by N Grid JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>P2</title>
<style type="text/css">
table.gridTable, table.gridTable td { border: 1px solid black; }
.u-paddedBottom { padding-bottom: 15px; }
</style>
</head>