Skip to content

Instantly share code, notes, and snippets.

View drenther's full-sized avatar
🏠
Working from home

Soumyajit Pathak drenther

🏠
Working from home
View GitHub Profile
@remy
remy / gist:350433
Created March 31, 2010 14:58
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@premasagar
premasagar / tim.js
Created August 12, 2010 17:52
A tiny, secure JavaScript micro-templating script. It doesn't use eval or (new Function), so it cannot execute malicious code.
/*
== Tim ==
A tiny, secure JavaScript micro-templating script.
This has now moved to:
github.com/premasagar/tim
*/
@rxaviers
rxaviers / gist:7360908
Last active May 24, 2024 10:40
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@gaearon
gaearon / Scrolljack.jsx
Last active April 1, 2020 17:11
Scrolljack.jsx
'use strict';
var React = require('react'),
PureRenderMixin = require('../mixins/PureRenderMixin'),
getSupportedTransformProperty = require('../utils/getSupportedTransformProperty'),
{ PropTypes, Children } = React;
const transformProperty = getSupportedTransformProperty();
const styles = {
root: {
@thure
thure / 1.1: Why state machines?.md
Last active February 6, 2023 14:56
SCXML Tutorials

Fundamentals: why state machines?

States. The final frontier. These are the voyages of an enterprising developer. Her eternal mission: to explore strange new techniques, to seek out better ways to engineer for mental models and new design patterns. To boldly go where a few awesome devs have gone before.

So you’ve found our poignant guide to SCXML and surely you’re wondering “Why should I want to go out of my way to use formal state machines?” or something like that. Hopefully this introduction addresses that kind of question.

An example: Nancy’s RPG

The problem

@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@emilniklas
emilniklas / gulpfile.js
Last active August 23, 2017 13:16
Gulpfile with LiveReload, Sass, and Browserify with Babelify (JSX harmony)
// ============================================================
// $ npm install --save-dev gulp-util node-notifier gulp vinyl-source-stream vinyl-buffer gulp-uglify gulp-sourcemaps gulp-livereload browserify watchify babelify gulp-ruby-sass gulp-autoprefixer gulp-rename
// ============================================================
function Workflow()
{
// Override workflow settings here
// Example:
// this.output.directory = 'public_html';
@desaroxx
desaroxx / avatar.js
Last active November 18, 2023 16:54
JavaScript: create github "like" identicon avatar (result: dataurl image/png)
(function() {
// see code in action: https://jsfiddle.net/desaroxx/jp4pmd2u/
/* Configuration variables */
var MAX_COLOR = 200; // Max value for a color component
var MIN_COLOR = 120; // Min value for a color component
var FILL_CHANCE = 0.5; // Chance of a square being filled [0, 1]
var SQUARE = 80; // Size of a grid square in pixels
var GRID = 5; // Number of squares width and height