Skip to content

Instantly share code, notes, and snippets.

View mgill25's full-sized avatar
:electron:

Manish Gill mgill25

:electron:
View GitHub Profile
@hausen
hausen / gist:9501041
Last active August 29, 2015 13:57
"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.

Problem

The date in [xkcd's comic number 1340][1] [does not change][2].

@istepura
istepura / hw5tests.rkt
Created February 28, 2013 01:54
Tests for homework 5, Programming Languages/Coursera
#lang racket
(require rackunit "hw5.rkt")
(require rackunit/text-ui)
(define hw5-tests
(test-suite
"Tests for HW 5"
(test-equal? "MUPL list -> Racket list #1"
(list (int 3) (int 4) (int 9))
@dgulino
dgulino / pyliner.py
Created February 10, 2013 16:19
Python script that runs one-liner python scripts similarly to how Perl runs them portions based on http://code.activestate.com/recipes/437932-pyline-a-grep-like-sed-like-command-line-tool/ (Graham Fawcett, Jacob Oscarson, Mark Eichin) interface inspired by Perl
#!/usr/bin/env python
"""
Python script that runs one-liner python scripts similarly to how Perl runs them
portions based on http://code.activestate.com/recipes/437932-pyline-a-grep-like-sed-like-command-line-tool/
(Graham Fawcett, Jacob Oscarson, Mark Eichin)
interface inspired by Perl
"""
@gnunicorn
gnunicorn / forms.html
Created October 13, 2011 16:02
Jinja2 WTForms macros for twitter bootstrap
{%- macro form_field_label(field) -%}
<label for="{{ field.id }}">{{ field.label.text }}
{%- if field.flags.required -%}
<abbr title="Diese Feld muss angegeben werden">*</abbr>
{%- endif %}</label>
{% endmacro %}
{%- macro form_field_description(field) -%}
{% if field.description %}
<span class="descr">{{ field.description }}</span>
@pmarreck
pmarreck / new_auto_link_regex_constant.rb
Created June 19, 2012 20:37
A URI detector/parser regex that is a better, but slower, auto_link regex for Rails (and a line that patches it in)
@projectivemotion
projectivemotion / Advanced Bash Usage CheatSheet.md
Last active August 25, 2018 16:28
Cheatsheet of advanced bash commands presented in Introduction to Advanced Bash Usage - James Pannacciulli. Youtube: https://youtu.be/uqHjc7hlqd0
@wycats
wycats / jsonapi.md
Created May 1, 2013 00:58
Ember APIs

JSON API

There are two JSON API styles:

  • The ID Style
  • The URL Style

The ID style is the easiest to get started with, but requires that your clients be able to guess the URLs for related documents. It also locks your API into a particular URL structure, which may become a problem as your API grows.

The URL style requires less guessing on the client side, and makes clients more resilient to API changes, but is trickier to use with relationships and compound documents.

@teropa
teropa / life.cljs
Created November 3, 2015 09:57
Conway's Life in ClojureScript
;; Credits:
;;
;; * ClojureScript
;; * Reagent https://reagent-project.github.io/
;; * Figwheel https://github.com/bhauman/lein-figwheel
;; * core.async https://clojure.github.io/core.async/
;; * Christophe Grand's Life implementation http://clj-me.cgrand.net/2011/08/19/conways-game-of-life/
(ns life.core
(:require [reagent.core :as r]
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@e000
e000 / donotuse.py
Created June 13, 2011 23:30
How to NEVER use lambdas.
##########################################################
# How to NEVER use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda constru-#
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] #
# by: e000 (13/6/11) #
##########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much anonymous "one line" functions