Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Brownman xavdid

🏠
Working from home
View GitHub Profile
@xavdid
xavdid / battleships.ts
Created Oct 29, 2020
I don't remember the context in which I wrote this, but I did! Finished it Jan 2017
View battleships.ts
interface Boat {
size: number
direction: 'horizontal'|'vertical'
start: Point
}
interface Point {
x: number,
y: number
}
View keybase.md

Keybase proof

I hereby claim:

  • I am xavdid on github.
  • I am xavdid (https://keybase.io/xavdid) on keybase.
  • I have a public key whose fingerprint is BA72 F26F 7A12 08FD EA39 C3CE 8E6C 0A2E 2B26 98E9

To claim this, I am signing this object:

@xavdid
xavdid / fast.rb
Last active May 29, 2019
Fast and the Furious Movie Name Generator - https://repl.it/repls/ArcticPettyConstant
View fast.rb
# run it here: https://repl.it/repls/ArcticPettyConstant
# fast and furious naming conventions are silly
print "Enter a two-word movie title base phrase: "
title = gets.chomp
parts = title.split(' ')
if parts.size > 2
puts "NO ONLY TWO WORDS"
exit
@xavdid
xavdid / extractor.js
Created Apr 4, 2018
Extracting Items from Timeline
View extractor.js
var items = $(".tl-slider-item-container")
.children()
.slice(1); // ignore the first item, it's a title card
var result = $.map(items, j => {
const el = $(j);
return {
year: el.find(".tl-headline-date")[0].innerText,
title: el.find(".tl-headline")[0].innerText,
content: el.find(".tl-text-content")[0].innerText
@xavdid
xavdid / test.js
Created Sep 28, 2017
jsfuck practice
View test.js
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((+(!+[]+!+[]+!+[]+[!+[]+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]
View schedule_generator.py
"""
get permutations of schedules and assign students to them
"""
import csv
from itertools import permutations
from random import choice
MAX_CLASS_SIZE = 27
@xavdid
xavdid / crash.txt
Created May 16, 2017
Chrome is crashing a lot today
View crash.txt
May 16 14:49:47 TBP GoogleSoftwareUpdateAgent[71264]: 2017-05-16 14:49:47.684 GoogleSoftwareUpdateAgent[71264/0x7fffb06d03c0] [lvl=2] -[KSAgentApp setupLoggerOutput] Agent settings: <KSAgentSettings:0x100538a30 bundleID=com.google.Keystone.Agent lastCheck=2017-05-16 17:35:22 +0000 checkInterval=18000.000000 uiDisplayInterval=604800.000000 sleepInterval=1800.000000 jitterInterval=900 maxRunInterval=0.000000 isConsoleUser=1 ticketStorePath=/Users/david/Library/Google/GoogleSoftwareUpdate/TicketStore/Keystone.ticketstore runMode=3 daemonUpdateEngineBrokerServiceName=com.google.Keystone.Daemon.UpdateEngine daemonAdministrationServiceName=com.google.Keystone.Daemon.Administration logEverything=0 logBufferSize=2048 alwaysPromptForUpdates=0 productIDToUpdate=(null) lastUIDisplayed=(null) alwaysShowStatusItem=0 updateCheckTag=(null) printResults=NO userInitiated=NO>
May 16 14:49:48 TBP ksadmin[71268]: Using ticket store: <KSPersistentTicketStore:0x10070e8e0 store=<KSKeyedPersistentStore:0x10070f120
path="/Library/G
@xavdid
xavdid / demo.ts
Created Mar 3, 2017
Typescript Demo
View demo.ts
import * as _ from 'lodash'; // or import _ = require('lodash')
interface HTTPRequest{
code: 200|400;
message: string;
}
class Employee {
name: string;
age: number;
View keybase.md

Keybase proof

I hereby claim:

  • I am xavdid on github.
  • I am xavdid (https://keybase.io/xavdid) on keybase.
  • I have a public key whose fingerprint is 0FF0 25F2 9820 1D4F 3E9D FBBE C291 498D 768E 39EE

To claim this, I am signing this object: