Skip to content

Instantly share code, notes, and snippets.

View gravicle's full-sized avatar

Amit Jain gravicle

  • San Francisco
View GitHub Profile
@gravicle
gravicle / 0_reuse_code.js
Created June 6, 2014 03:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gravicle
gravicle / HomeRowSpellCheck.swift
Created August 7, 2014 10:49
A simple swift program that corrects for 1-key-right typo.
// Author: Amit Jain
// License: MIT
// Date: 07/07/2014
// [7/2/2014] Challenge #169 [Intermediate] Home-row Spell Check : dailyprogrammer
// http://www.reddit.com/r/dailyprogrammer/comments/29od55/722014_challenge_169_intermediate_homerow_spell/
import Foundation
struct WordMeta {
@gravicle
gravicle / MapSurvey.swift
Created August 8, 2014 07:49
Implementation of /r/DailyProgrammer Challenge #168 in Swift
// [6/25/2014] Challenge #168 [Intermediate] Block Count, Length & Area : dailyprogrammer http://www.reddit.com/r/dailyprogrammer/comments/291x9h/6252014_challenge_168_intermediate_block_count/
// Author: Amit Jain
// Date: 08/08/2014
import Cocoa
struct Tile {
let char: Character // char represented
let x: Int // x position
let y: Int // y position
Intersecting Lines:
A B
A C
A E
A G
F G
@gravicle
gravicle / QuadraticExtremum.py
Created August 22, 2014 08:39
Extremum of a homogeneous quadratic function
# [9/20/2012] Challenge #100 [difficult] (Min-Max of N-Dimensional Quadratic) : dailyprogrammer http://www.reddit.com/r/dailyprogrammer/comments/106hps/9202012_challenge_100_difficult_minmax_of/
import numpy as np
import copy as copy
# quadratic form input
original = [[2, -2, -1], [-2, 1, 0], [-1, 0, 3]]
q = copy.deepcopy(original)
d = len(q) - 1
@gravicle
gravicle / Paper
Last active August 29, 2015 14:18
It has been contested that regulations do more good than harm as regulations restrict individuals from knowingly lying about facts according to several court cases, including Stratton Oakmont vs. Prodigy (1995). However, I believe that regulations are not a practical solution for preventing deceit and libel. Being the most prolific and widespread medium of communication, the internet has indeed been used to spread blatant lies about others, including executives of companies and politicians, but it also been a force to combat lies with the truth. For instance, in the court case Stratton Oakmont vs. Prodigy, libelous remarks were made on an online financial forum, named “Money Talk”, and the company took legal action against the internet service provider. According to the case, “a Prodigy user had posted about Daniel Porush, the president of Stratton Oakmont, claiming that it was too ‘soon to proven criminal’ and Stratton was a ‘cult of brokers who either lie for a living or get fired.’” (Court Cases). Prodigy
@gravicle
gravicle / HelperCrash.txt
Last active August 29, 2015 14:27
Github Desktop Crash on 10.11 β6 after giving permission to install helper
Process: GitHub Desktop [63294]
Path: /Applications/GitHub Desktop.app/Contents/MacOS/GitHub Desktop
Identifier: com.github.GitHub
Version: Bae Branch (209)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: GitHub Desktop [63294]
User ID: 501
Date/Time: 2015-08-13 10:36:46.912 -0500
//: Playground - noun: a place where people can play
import Foundation
protocol Compatible {
func equal(rhs: Compatible) -> Bool
}
extension String: Compatible {
func equal(rhs: Compatible) -> Bool {
+-------------------------+
| |
| |
| Coordinator |
| |
| |
+-------------------------+