Skip to content

Instantly share code, notes, and snippets.

@LukyVj
LukyVj / introjs_style.scss
Created June 26, 2014 09:25
Neutral intro.js stylesheet
@charset "UTF-8";
.introjs-overlay {
}
.introjs-showElement {
}
@zpao
zpao / README.md
Created June 6, 2011 17:56
autoconf 2.13 homebrew formula

Install

  1. install homebrew
  2. place autoconf.rb into Formula folder: /usr/local/Library/Formula/
  3. run brew install autoconf
@nimolix
nimolix / gist:4382065
Created December 26, 2012 18:30
Convert a numeric value into Persian words
String.prototype.persianThousandsSeparator = function () {
var val = this.toString();
var x = val.split('.');
var x1 = x[0];
var x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + '٬' + '$2');
}
return x1 + x2;
.3rdeden {
background-image: url(gravatar('regular@address.com', 'fallback@address.com'))
}
// generates a valid gravatar that defaults to company e-mail and then a known github e-mail
// ==UserScript==
// @name MOUSTACHE CHAT
// @author Robert Lemon
// @version 0.1
// @namespace http://rlemon.com
// @description Makes the chat all moustachy
// @include http://chat.stackexchange.com/rooms/*
// @include http://chat.stackoverflow.com/rooms/*
// ==/UserScript==
@arashmilani
arashmilani / gist:4732488
Created February 7, 2013 17:13
Trying to find much better way to assert Types in javascript rather than comparing types in string using typeof
function assertType(obj, type) {
return obj.constructor.name === type.name
}
console.info(assertType("test", String)); //true
console.info(assertType(1, String)); //false
console.info(assertType(1, Number)); //true
function Book(){};
function Desk(){};
@mars
mars / development.js
Last active May 11, 2017 17:22
Webpack config to support environment variables in JS source
module.exports = {
WEBPACK_ENV: JSON.stringify('development'),
FOO: JSON.stringify('per-environment foo value')
};
@afshinm
afshinm / bootstrap.messagebox.js
Created October 8, 2012 09:46
Twitter Bootstrap Message Box Plugin
(function ($) {
/* Twitter Bootstrap Message Helper
** Usage: Just select an element with `alert` class and then pass this object for options.
** Example: $("#messagebox").message({text: "Hello world!", type: "error"});
** Author: Afshin Mehrabani <afshin.meh@gmail.com>
** Date: Monday, 08 October 2012
*/
$.fn.message = function(options) {
//remove all previous bootstrap alert box classes
this[0].className = this[0].className.replace(/alert-(success|error|warning|info)/g , '');
@thewarpaint
thewarpaint / filter.js
Created August 25, 2014 04:30
Angular filter to convert numbers to thousand suffixes (1234 > 1.2k)
// Based on http://stackoverflow.com/questions/1571374/converting-values-to-unit-prefixes-in-jsp-page.
// The inner filter function can be used standalone.
angular.module('Utils')
.filter('thousandSuffix', function () {
return function (input, decimals) {
var exp, rounded,
suffixes = ['k', 'M', 'G', 'T', 'P', 'E'];
if(window.isNaN(input)) {
@mathiasbynens
mathiasbynens / jquery.preload.js
Created April 22, 2010 17:11
JavaScript preload() function
/*!
* $.preload() function for jQuery – http://mths.be/preload
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading.
*/
jQuery.preload = function(array) {
var length = array.length,