Skip to content

Instantly share code, notes, and snippets.

#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
#
# A simple theme that displays relevant, contextual information.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Screenshots:
# http://i.imgur.com/nBEEZ.png
#
@johnywith1n
johnywith1n / no-source-map.webpack.js
Created February 28, 2018 02:57
Example config for webpack not generating sourcemaps
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
mode: 'production',
entry: {
'app': [
@johnywith1n
johnywith1n / dota2_6_86_checker.js
Created December 14, 2015 21:41
check for 6.86 patch
'use strict';
var Promise = require('bluebird');
var request = Promise.promisifyAll(require('request'));
var open = require('open');
var FOUND = false;
function promiseWhile(predicate, action) {
function loop() {
@johnywith1n
johnywith1n / gist:44c628d7914f2afc52dd
Created January 22, 2015 23:47
elevatorsaga works until level 6
{
go: function (elevator) {
var self = this;
elevator.on("idle", function() {
self.queue.push(elevator);
});
elevator.on('floor_button_pressed', function (floor) {
elevator.goToFloor(floor);
@johnywith1n
johnywith1n / gist:9013097
Created February 15, 2014 01:31
Issue with elasticsearch node client.close
'use strict';
var elasticsearch = require('elasticsearch');
var deferred = require('deferred');
function Foo () {
this.client = new elasticsearch.Client({
hosts : 'localhost:9200',
log: 'error'
});
@johnywith1n
johnywith1n / gist:6984273
Created October 14, 2013 23:48
url regex
String URL_REGEX = "(?:https?:\\/\\/)?(?:[\\da-z\\.-]+)\\.(?:[a-z\\.]{2,6})(?:[A-Za-z0-9\\-\\+\\&\\@\\#\\/\\%\\?\\=\\~\\_\\(\\)\\|\\!\\:\\,\\.\\;]*)[A-Za-z0-9\\-\\+\\&\\@\\#\\/\\%\\=\\~\\_\\(\\)\\|]";
@johnywith1n
johnywith1n / gist:6944482
Last active December 25, 2015 08:09
Regex for white space other than the regular space (\u0020)
String OTHER_WHITESPACE_CHAR_CLASS = "["
+ "\\u0009" // CHARACTER TABULATION
+ "\\u000A" // LINE FEED (LF)
+ "\\u000B" // LINE TABULATION
+ "\\u000C" // FORM FEED (FF)
+ "\\u000D" // CARRIAGE RETURN (CR)
+ "\\u0020" // SPACE
+ "\\u0085" // NEXT LINE (NEL)
+ "\\u00A0" // NO-BREAK SPACE
+ "\\u1680" // OGHAM SPACE MARK