Skip to content

Instantly share code, notes, and snippets.

Avatar

Rad W radzhome

  • Postmedia
  • Ottawa
View GitHub Profile
@radzhome
radzhome / Process CSV File Python
Last active Aug 29, 2015
First Gist: Process a CSV File in Python/Django
View Process CSV File Python
#Test Gist
import csv
from models import RegistrationCode
REQUIRED_FIELDNAMES = frozenset([
'Registration code',
])
View 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
View gist:a7ab9e6dffa0f99849a3
#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>
View list certs
/* 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
View rexx rering
/* 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 Jul 25, 2015
An elevator sim, next steps add multiple elevators, use rabbitmq?
View elevator.py
"""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']
View countries.py
# 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'),
View states_provinces.py
# 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'),
View 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;
View 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>