Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
# drone.yml for node js CI with npm login | |
# Don't forget to configure DRONE_SERVER and DRONE_SERVER | |
# Now create a secrets.yml (OUTSIDE of your repo!!) (see other file) | |
# then run drone secure --repo <drone_repo_name> --in <path>/secrets.yml | |
build: | |
unit_tests: | |
image: risingstack/alpine:3.3-v4.2.6-1.1.3 | |
commands: | |
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
- npm install |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
'use strict'; | |
const _ = require('lodash'); | |
const bookshelf = require('../config/bookshelf'); | |
const hasher = require('../utils/hasher'); | |
require('./thing'); | |
let Example = Bookshelf.model.extend({ | |
tableName: 'examples', |
No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.
Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.
<?php | |
# Get contents from easylist domain | |
$content = file_get_contents('easylist.txt'); | |
# Extract adserver list only | |
preg_match('/(\!\s\*\*\*\seasylist:easylist\/easylist_adservers\.txt\s\*\*\*)[^"]+(\!\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-Third\-party\sadverts\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\!)/', $content, $extracted, PREG_OFFSET_CAPTURE); | |
/* | |
* Remove unnecessary strings from every URL |
/** | |
* Usage: | |
* | |
* import React from 'react'; | |
* import nullable from 'prop_nullable'; | |
* | |
* let myClass = React.createClass({ | |
* propTypes: { | |
* myProp: nullable( React.PropTypes.string ).isRequired, | |
* myOtherProp: nullable( [React.PropTypes.string, React.PropTypes.number] ) |
// Usage: | |
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
// then use as follows: | |
// | |
// query(term | [term, term, ...], term | [term, term, ...], ...) | |
// | |
// When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
// | |
// Term is of the format: | |
// ((-)text/RegExp) ( '-' means negation ) |
Basically, if you prefer to use DATABASE_URL in your application better than creating the whole database.yml thing, set the following ENV variable in your wercker app settings:
name: DATABASE_URL
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
require 'csv'
require 'open-uri'
csv_text = open('http://www.vvv.hh.yyy.ggg/~hhhh/uuuu.csv')
csv = CSV.parse(csv_text, :headers=>true)
csv.each do |row|
puts row
end