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
''' | |
You'll need to pip install some dependencies: | |
* python-dateutil | |
* requests | |
Also, populate your EMAIL and PASSWORD below. | |
''' | |
from xml.etree import ElementTree |
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
function diffdatastripped(legacy,shiny) { | |
let delta={},allgood=true; | |
for (const key in legacy){ | |
const oldval = legacy[key]; | |
const newval = shiny[key]; | |
if (typeof(oldval)==='object' && typeof(newval)==='object'){ | |
delta[key] = diffdatastripped(oldval,newval) | |
if (delta[key] !="✅") { | |
allgood=false; | |
} |
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
var mediumIntegrationToken = "REPLACE_WITH_YOUR_MEDIUM_INTEGRATION_TOKEN"; | |
// That's it. No need to edit anything else below. | |
// split the comma-separated tags string into an array then remove any whitespace | |
var tagsArray = input.medium_tags.split(','); | |
for (var i = 0; i < tagsArray.length; i++) { | |
tagsArray[i] = tagsArray[i].trim(); | |
} |
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
var __request = require('./logic.js').__request; | |
var urls = ["http://www.example.com/firts", "http://www.example.com/second", "http://www.example.com/third"]; | |
__request(urls, 'GET', false); |
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 isWalkable = value => value !== null && typeof value !== 'undefined'; | |
const getChild = (parent, child) => (isWalkable(parent) ? parent[child] : undefined); | |
const getIn = (descendants, origin) => descendants.split('.').reduce(getChild, origin); |
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
/* | |
* Code snippet for posting tweets to your own twitter account from node.js. | |
* You must first create an app through twitter, grab the apps key/secret, | |
* and generate your access token/secret (should be same page that you get the | |
* app key/secret). | |
* Uses oauth package found below: | |
* https://github.com/ciaranj/node-oauth | |
* npm install oauth | |
* For additional usage beyond status updates, refer to twitter api | |
* https://dev.twitter.com/docs/api/1.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
var mediumIntegrationToken = "REPLACE_WITH_YOUR_MEDIUM_INTEGRATION_TOKEN"; | |
// That's it. No need to edit anything else below. | |
// split the comma-separated tags string into an array then remove any whitespace |
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
#!/bin/bash | |
# node-reinstall | |
# credit: http://stackoverflow.com/a/11178106/2083544 | |
## program version | |
VERSION="0.0.13" | |
## path prefix | |
PREFIX="${PREFIX:-/usr/local}" |
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
# Outputs the reading time | |
# Read this in “about 4 minutes” | |
# Put into your _plugins dir in your Jekyll site | |
# Usage: Read this in about {{ page.content | reading_time }} | |
module ReadingTimeFilter | |
def reading_time( input ) | |
words_per_minute = 180 |
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
/** | |
* encode to handle invalid UTF | |
* | |
* If Chrome tells you "Could not decode a text frame as UTF-8" when you try sending | |
* data from nodejs, try using these functions to encode/decode your JSON objects. | |
* | |
* see discussion here: http://code.google.com/p/v8/issues/detail?id=761#c8 | |
* see also, for browsers that don't have native JSON: https://github.com/douglascrockford/JSON-js | |
* | |
* Any time you need to send data between client and server (or vice versa), encode before sending, |
NewerOlder