Skip to content

Instantly share code, notes, and snippets.

// Inspired by bling.js: https://gist.github.com/paulirish/12fb951a8b893a454b32
// But we needed full module encapsulation
// This will concat anything including array-like things(like NodeLists or HTMLCollections)
let concat = function(...args) {
return args.reduce((result, item) => {
// If array-like
if(
item && item.length !== undefined && !Array.isArray(item) &&

Gitter Desktop App authentication

If you feel uncomfortable signing into GitHub in the node-webkit frame, these instructions will go over a manual way to authorize and set your token.

Note: This guide assumes Gitter is already an authorized app for your GitHub account. To do this, just make sure you can sign in with the web client in your browser.

Get your personal token

Use the login link in the top right of the developer.gitter.im.

@MadLittleMods
MadLittleMods / svn-remove-missing.js
Last active October 1, 2015 16:24
Removes files that are missing from the repo. `node svn-remove-missing.js`
var exec = require('child_process').exec;
var svnRemoveFile = function(filePath) {
var child = exec('svn rm "' + filePath + '" --force', function(err, stdout, stderr) {
/* * /
if(err) {
console.log(err);
}
if(stderr) {

I noticed that I could no longer use SSH to git clone, push, etc in the Windows CMD prompt.

git clone no longer working with SSH

You may be getting these errors:

  • Error connecting to agent: No such file or directory
  • permission denied (publickey)

It turns out that setting a HOME environment variable will mess up the OpenSSH commands; probably because it can't find the .ssh directory(C:\Users\my_user\.ssh).

@MadLittleMods
MadLittleMods / test-sidecar-button-present.js
Last active October 13, 2015 04:50
selenium-webdriver example with browserstack.com
// See: https://www.browserstack.com/automate/node
// API: http://selenium.googlecode.com/git/docs/api/javascript/index.html
// Capabilities
// - https://www.browserstack.com/automate/capabilities
// - Capability platform/os configurator: https://docs.saucelabs.com/reference/platforms-configurator/#/
//
// How can I use selenium-webdriver package with SauceLabs?: http://stackoverflow.com/q/21170734/796832
// # Setup
//
@MadLittleMods
MadLittleMods / gulp-plugin-wrap-other-plugins.js
Last active October 13, 2015 21:55
A gulp plugin that wraps other plugins. Note: This may not be completely working. Use `gulp-piece` instead: https://www.npmjs.com/package/gulp-piece
var objectAssign = require('object-assign');
var through = require('through2');
var gutil = require('gulp-util');
var createThroughNoop = function() {
return through.obj(function(chunk, enc, cb) {
this.push(chunk);
cb();
});

Zoom the Gitter Desktop window

  • On Windows: Gitter -> Developer Tools

Paste this into the console, change the zoomLevel to the desired value.

var desktopWindow = gui.Window.get();
desktopWindow.zoomLevel = 0;
var gulp = require('gulp');
var through = require('through2');
var gutil = require('gulp-util');
var buffer = require('vinyl-buffer');
var source = require('vinyl-source-stream');
var exhaustively = require('stream-exhaust');
var objectAssign = require('object-assign');
var sourcemaps = require('gulp-sourcemaps');
var browserify = require('browserify');
"rule-properties-order": [2, [
{
"-group-overview": [
"all",
"content",
"box-sizing",
"will-change",
]
},