Skip to content

Instantly share code, notes, and snippets.

@armandocanals
armandocanals / largeSum.js
Created May 2, 2016 23:50
Sum Large Numbers in JavaScript
function add(num1, num2) {
num1 = num1.split('');
num2 = num2.split('');
num1 = num1.map(function (num) {
return parseInt(num, 10);
});
num2 = num2.map(function (num) {
return parseInt(num, 10);
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@number5
number5 / git-log.md
Last active July 9, 2019 21:40
pretty git log with relative dates and tags

My git log alias

alias gl='git log --graph --pretty=format:'%C(magenta)%h%Creset %w(72,1,2)%Cgreen(%cr) -%C(bold green)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative'

gl screenshot

@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@certainlyakey
certainlyakey / library.scss
Last active March 5, 2024 16:40
URL-encode color SASS function / convert color to hex SASS function
//does not work with colors containing alpha
@function encodecolor($string) {
@if type-of($string) == 'color' {
$hex: str-slice(ie-hex-str($string), 4);
$string:unquote("#{$hex}");
}
$string: '%23' + $string;
@return $string;
}
@jonobr1
jonobr1 / auto-capture.scpt
Last active March 21, 2024 02:34
A small AppleScript to take a screenshot every 30 seconds for 8 hours. Saves to an Image Sequence in a desktop folder. Great for recording your workday.
set dFolder to "~/Desktop/screencapture/"
do shell script ("mkdir -p " & dFolder)
set i to 0
repeat 960 times
do shell script ("screencapture " & dFolder & "frame-" & i & ".png")
delay 30 -- Wait for 30 seconds.
set i to i + 1
end repeat
anonymous
anonymous / index.html
Created February 21, 2015 20:16
JS Bin Custom Directive Chart // source http://jsbin.com/cafapi
<!DOCTYPE html>
<html ng-app="chart">
<head>
<meta name="description" content="Custom Directive Chart">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
label{
width:55px;
@ahmedam55
ahmedam55 / gist:183ac065be9b7dd2ce5f
Created January 2, 2015 13:14
SPA problem with setIntervals and animation
for(var i=0;i<99999;i++){
clearInterval(i);
clearTimeout(i);
}
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — 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