Skip to content

Instantly share code, notes, and snippets.

ahirschberg / barclays_summer.js
Last active February 23, 2020 19:55
Creates a {Name: Sum} mapping of all the transactions on a Barclays bank statement page for a desired month
View barclays_summer.js
(month_desired => {
let store = {}
let transactions = document.querySelectorAll('.panel');
for (let t of transactions) {
let name = t.querySelector('.description').innerText;
let amt = parseInt(t.querySelector('.amount').innerText.replace(/[^0-9.]/g, ''));
let date = t.querySelector('.date').innerText;
if (date.toLowerCase().substring(0,3) != month_desired) {
console.log("Skipping", date);
} else {
ahirschberg /
Last active February 7, 2018 01:43
Moves canvas files into student folders
# change this to the folder where your jar files are
# you can download it from
# just change /usr/share/java to wherever you downloaded stuff (downloads, maybe)
# change these to the correct filenames for the jars you have
ahirschberg /
Last active August 2, 2017 21:48
Alex Hirschberg brand dotfiles
# Install script for dotfiles repo
# Copyright © 2017 Alex Hirschberg
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
ahirschberg /
Last active February 16, 2017 02:37
Made as a homework for Georgia Tech's CS1331 course in Spring 2017

CS1331 Homework 01 - Straight As

Welcome to your first full-fledged programming assignment for CS1331! In this homework, you will be tasked with reading data files and using what you've learned so far to create a visualization of the data in your terminal.

Download zip

Things to know

This homework has several files contained within it. Here are some notes about them:

import java.util.Set;
import java.util.HashSet;
public class TestTypes {
public static void main(String[] args) {
Class<?> t = Set.class;
Object s = new HashSet<String>();
Object n = new Integer(-1);
System.out.println(t.isInstance(s)); // true
System.out.println(t.isInstance(n)); // false
ahirschberg / master.rb
Created December 22, 2016 15:54
test ruby -> python interop via pipes
View master.rb
require 'open3'
require 'json'
require 'pry'
module Interop
def self.send json
result, status = Open3.capture2("python",
stdin_data: json)
status.to_s # noop, get rid of unused variable warning
View nin10kitprojectile.c
* Exported with nin10kit v1.3
* Time-stamp: Tuesday 12/20/2016, 19:24:41
* Image Information
* -----------------
* /home/alex/projects/cool_game/assets/projectile_sprites.png 8@32
* Quote/Fortune of the Day!
* -------------------------
ahirschberg / mysort.c
Last active February 16, 2017 02:39
C Code for a CS2110 Sort Example, and my system output
View mysort.c
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#define OFFSET(arr, idx, size) ((void*) ((char*)arr) + ( idx ) * ( size ) )
// bubble sort
void yoursort(void *arr, size_t nelems, size_t size, int (*compar) (const void *, const void *)) {
bool swapped = true;
ahirschberg / ta_hw0_batch.rb
Last active September 7, 2016 00:59
View ta_hw0_batch.rb
require 'pathname'
require 'shellwords'
dirs ='.') { |c| }
pwd = Pathname.pwd
Dir.mkdir pwd + 'output'
rescue Errno::EEXIST
puts "directory existed already. great..."
dirs.each do |dir|
ahirschberg / pubspec.yaml
Last active May 3, 2016 21:13
For dart angular2 issue #8439: [Dart Angular2-beta.17] platform_directives only apply when compiled to JavaScript, not in Dart
View pubspec.yaml
name: angular2_getting_started
description: Quickstart
version: 0.0.1
sdk: '>=1.13.0 <2.0.0'
angular2: 2.0.0-beta.17
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1