Skip to content

Instantly share code, notes, and snippets.

@zzeleznick
zzeleznick / SassMeister-input-HTML.html
Created March 9, 2015 06:37
Generated by SassMeister.com.
<button type="button">I look amazing</button>
@zzeleznick
zzeleznick / SassMeister-input-HTML.html
Created March 9, 2015 06:52
Generated by SassMeister.com.
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
</div>
</div>
@zzeleznick
zzeleznick / log.md
Last active October 8, 2015 14:42
Log File for Horizontal Seam Removal

Running Seam removal check for a HORIZONTAL_CROP of 100 for 14 files.

id Name 2-D Size 1-D Size
0 binaryText.jpg (483, 604) 291732
1 couch.jpg (500, 375) 187500
2 homework.jpg (800, 600) 480000
3 house.jpg (384, 512) 196608
@zzeleznick
zzeleznick / README_p4.md
Created October 8, 2015 14:48
Seam Carving Project Documentation

CS194-26: Context-Based Image Resizing (Project 4)

Author: Zachary Zeleznick SID: 2324051 Date: 10/06/2015

Layout

Functional Directories: Do not remove

@zzeleznick
zzeleznick / buttons.swift
Last active March 6, 2016 23:37
A simple function to make buttons programmatically in swift
// MARK: - Storyboard Connections
@IBOutlet weak var letterContainer: UIView! // the UIView that will contain the buttons
// ... stuff
// MARK: Place method call in ViewDidLoad
func makeButtons(content: [String], margin: CGFloat, bottom: CGFloat) {
for i in 0...content.count-1 {
let button: UIButton = UIButton(type: UIButtonType.System)
button.setTitle(content[i], forState: UIControlState.Normal)
@zzeleznick
zzeleznick / GreedyDict.py
Last active August 9, 2016 16:33
Steals away keys from children
from collections import OrderedDict
"""Q: How do we define a data structure that makes it easy
to determine which keys should be passed to children
and which should be passed to report summaries.
And which keys should be promoted?
## Thoughts:
- CAPS_AND_UNDERSCORE signify importance
- Optional updates
- All keys should be passed to children by default
@zzeleznick
zzeleznick / piazza_hotkeys.js
Created September 6, 2016 16:39
Provides hotkey support for piazza. Paste into the Chrome Dev Console for use.
var piazza_hotkeys = function() {
/*
Provides hotkey support for navigating many posts on piazza.
1) a + alt: archives the current post and navigates to the previous post
2) i + alt: marks the current post as unread and navigates to the previous post
3) up + alt: navigates to the more recent post from current
4) down + alt: navigates to the older post
*/
// keycodes: https://css-tricks.com/snippets/javascript/javascript-keycodes/
const A = 65;
@zzeleznick
zzeleznick / delta.py
Last active September 13, 2016 06:13
String Comparisons
from __future__ import print_function
import time
import math
import numpy as np
import argparse
FFT = np.fft.fft
IFFT = np.fft.ifft
zprint = globals()['__builtins__'].print
@zzeleznick
zzeleznick / closest_points.py
Last active September 13, 2016 10:13
Finds the closest points (and minimum distance) from an array of points.
from __future__ import print_function
import time
import numpy as np
from scipy.spatial.distance import cdist
# from scipy.spatial.distance import euclidean
from bisect import bisect_left
import argparse
zprint = globals()['__builtins__'].print
@zzeleznick
zzeleznick / cloner.py
Created November 3, 2016 04:45
Clones repos for student projects to be graded
import os, sys
import subprocess
# Internal Python Modules
from get_urls import URLS
DEST = "repos"
class FileManager(object):
dest = DEST