s%\(await .*\).then(\(.*\) => {%const \2 = \1;
s%.then(() =>\_.\W*\(.*\)%await \1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
const Protobuf = require('pbf'); | |
const { VectorTile } = require('@mapbox/vector-tile'); | |
const { Headers } = fetch; | |
async function logTile(url) { | |
const res = await fetch(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version 5.4 | |
" pathogen! | |
call pathogen#infect() | |
call pathogen#helptags() | |
autocmd! | |
filetype on | |
filetype plugin on | |
syntax on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net from 'net'; | |
/** | |
* In production, log stats to graphite if a connection is available. | |
* In dev, console.log 'em. | |
*/ | |
export default class StatsLoggerClient { | |
constructor(GRAPHITE_HOST, GRAPHITE_PORT) { | |
if (GRAPHITE_HOST && GRAPHITE_PORT) { | |
this.GRAPHITE_HOST = GRAPHITE_HOST; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// toggle files in PR review | |
document.querySelectorAll('.file-actions button.js-details-target').forEach(function(el) {el.click()}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FoobarTest { | |
String bar; | |
public String messyScope() { | |
String bar; | |
bar = 'messy'; | |
return bar; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import threading | |
import urllib2 | |
class ThreadHandler(threading.Thread): | |
def __init__(self, blocking_function): | |
threading.Thread.__init__(self) | |
self.runnable = blocking_function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search through only the diff files from https://archive.org/download/IRS990-efile | |
cd IRS990-efile/irs_form990_schemas | |
mkdir diffs | |
cd diffs | |
for diffdir in `find ../ -name '*Diffs*'`; do ln -s $diffdir; done | |
# Now, we have a directory full of symlinks to the diff dirs in each of the schema versions. | |
# We can grep freely now: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE py13_990 ( | |
"EIN" VARCHAR(9) NOT NULL, | |
tax_pd INTEGER NOT NULL, | |
subseccd VARCHAR(2) NOT NULL, | |
s501c3or4947a1cd BOOLEAN NOT NULL, | |
schdbind BOOLEAN NOT NULL, | |
politicalactvtscd BOOLEAN NOT NULL, | |
lbbyingactvtscd BOOLEAN NOT NULL, | |
subjto6033cd BOOLEAN NOT NULL, | |
dnradvisedfundscd BOOLEAN NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\Core\File\FileSystem; | |
use Drupal\file\Entity\File; | |
$container = \Drupal::getContainer(); | |
$eq = $container->get('entity.query'); | |
$fs = $container->get('file_system'); |
NewerOlder