Skip to content

Instantly share code, notes, and snippets.

View MusikAnimal's full-sized avatar

MusikAnimal

View GitHub Profile
/**
* Node script to import COVID-19 data from nyc.gov's official dataset.
* The raw JSON should be pasted into https://commons.wikimedia.org/wiki/Data:COVID-19_cases_in_New_York_City.tab
* The wikitext is for the table at https://en.wikipedia.org/wiki/2020_coronavirus_pandemic_in_New_York_City
*/
const getScript = (url) => {
return new Promise((resolve, reject) => {
const http = require('http'),
https = require('https');
@MusikAnimal
MusikAnimal / i18n_helper.js
Created October 26, 2017 05:09
Quickly import, rename, or delete i18n messages
/**
* Quickly import, rename, or delete i18n messages.
*
* To use, add the necessary code below
* and run `node i18n_helper.js`.
*
* WARNING: these functions may run asynchronously,
* so use only one at a time (or implement a callback)
* to ensure you don't end up with corrupt files.
*/
<?php
use GuzzleHttp;
use GuzzleHttp\Promise\Promise;
// 20 pages, so theoretically will take ~200ms to process
$pages = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'];
$client = new \GuzzleHttp\Client();
$promises = [];
@MusikAnimal
MusikAnimal / config.php
Last active August 24, 2016 03:47
config.php for Travis CI
<?php
// Define the root of the project directory so that the vendor and messages directories
// can be accessed with non-relative paths.
define( 'ROOTDIR', '/home/travis/build/MusikAnimal/pageviews' );
define( 'METAROOT', '' );
@MusikAnimal
MusikAnimal / gist:c2a2f79b6976e7ddd909
Last active March 17, 2016 16:31
PHP setup on Travis CI
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot PATH
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory PATH >
Options Indexes MultiViews FollowSymLinks
@MusikAnimal
MusikAnimal / .gitconfig
Last active October 26, 2017 05:12
Make your git output more colorful and fun
[user]
name = Username
email = Email
[github]
user = Username
token = ***
[color]
branch = auto
diff = auto
status = auto