Skip to content

Instantly share code, notes, and snippets.

View scriptype's full-sized avatar
🍁

Mustafa Enes Ertarhanaci scriptype

🍁
View GitHub Profile
@cedricbellet
cedricbellet / Bitwise AND
Last active September 19, 2016 19:25
Representation of the bitwise AND pattern
.
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@kvz
kvz / Makefile
Last active August 28, 2021 14:35
The only Makefile for Node.js projects you'll ever need - https://twitter.com/kvz/status/685853830425231361
# Licensed under MIT.
# Copyright (2016) by Kevin van Zonneveld https://twitter.com/kvz
#
# This Makefile offers convience shortcuts into any Node.js project that utilizes npm scripts.
# It functions as a wrapper around the actual listed in `package.json`
# So instead of typing:
#
# $ npm script build:assets
#
# you could just as well type:
@hwclass
hwclass / MessageStore.js
Last active March 17, 2016 09:54
Mixin Builder : An example using compositional inheritance to create new functionalities by mixin curations.
var MessageStore = (function MessageStore () {
return {
HOLDING_THE_WHELL : 'holding whell...',
FIRING_THE_ENGINE : 'firing the engine...',
FULLING_THE_TANK : 'fulling the tank...',
HOLDING_THE_STICK : 'holding the stick'
}
})();
@paulirish
paulirish / what-forces-layout.md
Last active March 17, 2026 07:48
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@hwclass
hwclass / ajax.js
Created July 2, 2015 09:24
Design Patterns : Publish / Subscribe Pattern
/**
* @fileoverview The sample js file that are thought that publishes the coming data from an API endpoint
* @author hwclass
*/
/**
* ajax.js
* This file contains a publish command for productsFetchedEvent
*/
@hwclass
hwclass / Module.js
Last active March 1, 2016 23:06
Design Patterns : Module Pattern
/**
* @fileoverview The base object to generate modules
* @author hwclass
*/
/**
* models/Module.js
* This object is used to generate some instances
* as modules to be attached into the MODULES array.
*/
@pamelafox
pamelafox / solar_system_objects.sql
Last active August 31, 2025 10:48
solar_system_objects.sql
/*
Solar system objects
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size
Collected by: https://www.khanacademy.org/profile/patrick809/programs
*/
CREATE TABLE solar_system_objects(
body TEXT
, mean_radius NUMERIC /* km */
, mean_radius_rel NUMERIC /* relative to earth */
, volume NUMERIC /* 10^9 km^3 */
@koba04
koba04 / .gitignore
Last active December 21, 2018 02:21
karma + mocha + browserify + babel + power-assert
node_modules/
@esimov
esimov / simplexnoise.js
Created October 6, 2014 08:47
Simplex noise implementation in Javascript
var NOISE = NOISE || { };
NOISE.Simplex = (function() {
var iOctaves = 1,
fPersistence = 0.5,
fResult, fFreq, fPers,
aOctFreq, // frequency per octave
aOctPers, // persistance per octave
fPersMax; // 1 / max persistence