Skip to content

Instantly share code, notes, and snippets.

View scriptex's full-sized avatar
🎨
Making email safer | Painting the pixels on your screen

Atanas Atanasov scriptex

🎨
Making email safer | Painting the pixels on your screen
View GitHub Profile
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@letsgetrandy
letsgetrandy / render.js
Last active April 14, 2018 19:04
Simple template rendering for Javascript
/* Simple JS template rendering function */
function render(obj, template) {
var re, v;
re = new RegExp("\\[\\[([^\\]]+)\\]\\]");
while (match = re.exec(template)) {
val = obj[match[1]] || '';
template = template.replace(match[0], val);
}
return template;
}
@letsgetrandy
letsgetrandy / fmtWholeNum.js
Last active January 19, 2017 19:49
Format whole numbers with commas at every 3rd digit.
function fmtWholeNum (num) {
var n = parseFloat(num.toString().replace(/[^\d\.]+/, '')),
s = Math.floor(n).toString();
return s.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")
}
@addyosmani
addyosmani / README.md
Last active October 17, 2024 13:41 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

function Color(r, g, b) {
if (Array.isArray(r)) {
colors = r;
} else if (!g && !b) {
colors = this.asRGB(r);
} else {
colors = [r, g, b];
}
this.r = colors[0];
this.g = colors[1];
// language exceptions
var exceptions = {
"are": "were",
"eat": "ate",
"go": "went",
"have": "had",
"inherit": "inherited",
"is": "was",
"run": "ran",
"sit": "sat",
@roachhd
roachhd / README.md
Last active November 15, 2024 09:34
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@neilcarpenter
neilcarpenter / gist:8979ea9ed91b10e36af9
Created March 5, 2015 11:03
Enable Emmet in .JSX files, using Babel JSX Syntax highlighter
// add to Preferences > Key Bindings - User
// see http://stackoverflow.com/a/26619524 for context
{ "keys": ["tab"], "command": "expand_abbreviation_by_tab",
"context": [
{
"operand": "source.js",
"operator": "equal",
"match_all": true,
"key": "selector"