Skip to content

Instantly share code, notes, and snippets.

View xavdid's full-sized avatar
🏠
Working from home

David Brownman xavdid

🏠
Working from home
View GitHub Profile
@xavdid
xavdid / example.js
Created April 10, 2016 23:55
Fat arrow scope conundrum
'use-strict';
// using node v5.7.1
var funcs = {
speak: function(){
console.log(this.name + ' says hi');
},
name: 'david'
};

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:

@xavdid
xavdid / demo.ts
Created March 3, 2017 16:42
Typescript Demo
import * as _ from 'lodash'; // or import _ = require('lodash')
interface HTTPRequest{
code: 200|400;
message: string;
}
class Employee {
name: string;
age: number;
@xavdid
xavdid / crash.txt
Created May 16, 2017 21:58
Chrome is crashing a lot today
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
"""
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 / test.js
Created September 28, 2017 19:15
jsfuck practice
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((+(!+[]+!+[]+!+[]+[!+[]+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]
@xavdid
xavdid / extractor.js
Created April 4, 2018 23:16
Extracting Items from Timeline
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 / fast.rb
Last active May 29, 2019 19:33
Fast and the Furious Movie Name Generator - https://repl.it/repls/ArcticPettyConstant
# 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

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: