Skip to content

Instantly share code, notes, and snippets.

Avatar

James Milne shakna-israel

View GitHub Profile
@shakna-israel
shakna-israel / googlecalendarapicurrentevents
Created Aug 8, 2014
Google Calendar - Current Events via API
View googlecalendarapicurrentevents
<script type="text/javascript">
<!--
/**
* Converts an xs:date or xs:dateTime formatted string into the local timezone
* and outputs a human-readable form of this date or date/time.
*
* @param {string} gCalTime is the xs:date or xs:dateTime formatted string
* @return {string} is the human-readable date or date/time string
*/
function formatGCalTime(gCalTime) {
@shakna-israel
shakna-israel / compress.sh
Created Oct 27, 2014
Automatic Image Compression Script
View compress.sh
# Requires jpegoptim, pngquant, optipng, gifsicle as well as scour and python.
# The scour.py file should be located at ~/scour/scour.py
# IMPORTANT: This script OVERWRITES existing image files.
# Licensed under the MIT License
# The MIT License (MIT)
@shakna-israel
shakna-israel / gist:b213d04045882db3b381
Created Nov 23, 2014
This does not process as sass, due to liquid.
View gist:b213d04045882db3b381
---
---
{% for posts in site.posts %}
#{{ post.id }} {
overflow:hidden;
width:100%;
height:auto;
background-image:url("{{ "assets/img/" | append post.img }}")
}
@shakna-israel
shakna-israel / serve.py
Created Jan 13, 2015
CherrPy QuickServe
View serve.py
import cherrypy
import os.path
current_dir = os.path.dirname(os.path.abspath(__file__))
class RootPage:
def index(self):
raise cherrypy.HTTPRedirect("/static/index.html")
@shakna-israel
shakna-israel / nginx.conf
Created Jan 14, 2015
Nginx Reverse Proxy
View nginx.conf
server {
listen 80;
server_name example.org;
access_log /var/log/nginx/example.log;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
View .bashrc
export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s)") \[\033[01;34m\]$\[\033[00m\] '
View catch.py
filePointer = open('catchme.py', 'r')
builtFunc = []
for lines in filePointer:
if lines[:3] == 'def':
inFunc = True
if inFunc == True:
if lines[0] == lines.strip():
inFunc = False
builtFunc.append(lines.strip())
filePointer.close()
@shakna-israel
shakna-israel / directory_tree
Created Apr 5, 2016
Zappa Folder Structures
View directory_tree
```
.
├── curlTimerFormat.txt
├── env
│   ├── bin
│   │   ├── activate
│   │   ├── activate.csh
│   │   ├── activate.fish
│   │   ├── activate_this.py
│   │   ├── aws
@shakna-israel
shakna-israel / unittest.scm
Created Jul 1, 2016
Unit Testing Framework for Scheme
View unittest.scm
;
; Unit test framework for scheme, originally by http://c2.com/cgi/wiki?JohnClonts
; Heavily modified by me, https://github.com/shakna-israel
;
#|
This is a brain-dead simple unit-testing framework.
It differs wildly from John Clonts' which is where it began life (http://c2.com/cgi/wiki?SchemeUnit), but that was mainly aimed at number equivalency testing.
Basic Usage:
View keybase.md

Keybase proof

I hereby claim:

  • I am shakna-israel on github.
  • I am shakna (https://keybase.io/shakna) on keybase.
  • I have a public key whose fingerprint is CE67 2507 AB85 EA82 46A5 D3B6 A089 B2D6 AA04 9EFE

To claim this, I am signing this object:

You can’t perform that action at this time.