Skip to content

Instantly share code, notes, and snippets.

@dliv
dliv / keybase.md
Created October 21, 2016 01:18
keybase.md

Keybase proof

I hereby claim:

  • I am dliv on github.
  • I am dliv (https://keybase.io/dliv) on keybase.
  • I have a public key ASCnczhAsyysZAwVbIGZgWYgr2etNYAA95_lZmTFTH7gMAo

To claim this, I am signing this object:

@dliv
dliv / GlobalTester.js
Created September 13, 2016 12:05
Tech Debt - Find globals on window
// adapted from: http://stackoverflow.com/a/14063123
// this would be useful as a Chrome extension
class GlobalTester {
static fields = {};
static before () {
for (let field in window) {
if (window.hasOwnProperty(field)) {
GlobalTester.fields[field] = true;

Find id of extension by visiting chrome://extensions, e.g. felcaaldnbdncclmgdcncolpebgiejap

Add id to command below:

open ~/Library/Application\ Support/Google/Chrome/Default/Extensions/<id>
@dliv
dliv / skittles.js
Last active December 9, 2015 07:06
interview - coding screen
var assert = require('assert');
/********************************
* We want make a package of goal kilos of skittles. We have
* inventory of small bags (1 kilos each) and big bags (5 kilos each).
* Return the number of small bags to use, assuming we always
* use big bags before small bags. Return -1 if it can't be done.
*
* See the asserts below for examples of input
* and expected output.
@dliv
dliv / sublime-user-prefs.json
Last active December 9, 2015 07:14
sublime-user-prefs.json
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/IDLE.tmTheme",
"font_size": 10,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
@dliv
dliv / .editorconfig
Last active January 2, 2016 15:35
Editor Config (4 spaces, *nix line endings)
# http://editorconfig.org
#
# An .editorconfig file describes minor formatting tweaks
# to apply to text files to ensure consistent formatting
# in a project with multiple developers.
#
# Plugins exist to allow editors / IDEs to automatically apply
# these tweaks to a project when an .editorconfig file is
# found in the project's root directory.
#
@dliv
dliv / Base36.cs
Created July 31, 2014 15:08
Base36 Encoding
using System;
using System.Collections.Generic;
using System.Linq;
namespace Minimize.Models.Utils
{
public class Base36
{
private const string Base36CharSet = "0123456789abcdefghijklmnopqrstuvwxyz";
@dliv
dliv / Scrape.cs
Created September 29, 2013 17:51
Webscraping with .Net
using System;
using System.IO;
using System.Net;
namespace WebScrapingTest
{
class Program
{
static void Main(string[] args)
{