View apple.js
// Compare Apple products without marketing BS.
// => http://www.apple.com/ipad/compare/
document.querySelectorAll('.device-sections tr').forEach(tr => {
const toDelete = [];
let lastGroup;
Array.from(tr.querySelectorAll('td')).forEach(td => {
const text = td.innerText.trim();
if (lastGroup === text) {
toDelete.push(td);
} else {
View nodejs-bench-tools.js
const nanoseconds = () => {
const hr = process.hrtime();
return hr[0] * 1e9 + hr[1];
};
const benches = {};
const bench = (key, action) => {
const atStart = nanoseconds();
const result = action();
const ms = (nanoseconds() - atStart) / 1000000;
View dropkick.sh
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
View brunch-config.coffee
exports.config =
files:
javascripts: joinTo: 'javascripts/app.js'
stylesheets: joinTo: 'stylesheets/app.css'
templates: joinTo: 'javascripts/app.js'
View aws-s3-v2.rb
require 'aws-sdk'
require 'aws-sdk-resources'
config = {region: 'us-west-1', bucket: 'test', key: 'key', secret: 'secret'}
Aws.config.update({region: config[:region], credentials: Aws::Credentials.new(config[:key], config[:secret])})
bucket = Aws::S3::Resource.new.bucket(bucket: config[:bucket])
# ============
# Create file.
obj = bucket.object(path)
View __init__.py
import reclaimer
import uploader
# Example app code is mp7sh5jd6
View styl-replacer.js
var fs = require('fs');
var sysPath = require('path');
function ReplacerPlugin(config) {
if (config == null) config = {};
var params = (config && config.plugins && config.plugins.stylReplacer) || {};
this.rootPath = config.paths.root;
this.patterns = params.replaceWith || {};
}
View grunt.js
module.exports = function ( grunt ) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
*/
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
View iPhone-6-plus.css
/* iPhone 6 Plus & iPad Air 2 media query (Retina HD displays).
Also works for similar Android devices. */
/* Use x2 images by default. */
.logo {
background-image: url(http://hellyeah.is/images/text-logo-ns@x2.png);
height: 300px;
width: 100%;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
View script.js
[].slice.call(document.querySelectorAll('[ng-repeat="match in feed"]'))
.filter(function(s) {return s})
.map(function(single) {
var qe = single.querySelector('.question .inner h2');
if (!qe) return;
var q = qe.textContent;
var a = single.querySelector('.response .inner p').textContent;
return {q: q.trim(), a: a.trim()}
})
.filter(function(s) {return s})