Skip to content

Instantly share code, notes, and snippets.

View stryju's full-sized avatar

tomasz stryjewski stryju

  • Meta
  • Kailua, HI
  • 17:11 (UTC -10:00)
View GitHub Profile
@stryju
stryju / _intro.md
Last active August 24, 2022 16:28
something something **es6**

something something es6

a bit cleaned up version of my "slides"

disclaimer: this "talk" was done to show some "real life use cases" to simplify the knowledge I mainly got from Axel Rauschmayer's articles

why "destructring is a good way to go"

function useFPS() {
const [fps, setFPS] = useState(0);
useEffect(() => {
let then = performance.now();
let frames = 0;
let req;
(function loop(now) {
req = window.requestAnimationFrame(loop);
@stryju
stryju / minimold.js
Created July 6, 2012 10:58
mini-templating engine ( minimold ) - uses {{single_replace}} and {{iterator}}...{{/iterator}} from some ELEMENT
/*
* usage:
*
* tmpl( id_of_template_source:string , [template_data:object] );
*
*/
var minimold = (function(){
"use strict";
var cache = {};
@stryju
stryju / esnextbin.md
Created January 12, 2017 10:50
esnextbin sketch
@stryju
stryju / esnextbin.md
Last active September 13, 2016 14:03
esnextbin sketch
@stryju
stryju / quicksort.js
Created October 6, 2015 07:56
quicksort (haskell-inspired) in es6
function quicksort([ x, ...xs ]) {
if (!arguments[0].length) return [];
return [ ...xs.filter( y => y <= x ), x, ...xs.filter( y => y > x ) ];
}
@stryju
stryju / _normalize.scss
Created August 16, 2012 09:57
custom normalize
/*! normalize.css v1.0.0 | MIT License | git.io/normalize */
/*
* usage:
* @import "normalize";
*
* // this will print out ALL selectors
* @include normalize();
*
* // this will print out minimal set (*) -- you can see the list of "excluded" tags below
@stryju
stryju / package.json
Created January 17, 2014 15:57
use nodemon for watching local changes and restarting your server with simple `npm start`
{
"scripts": {
"start": "nodemon -w . index.js"
},
"dependencies": {
"nodemon": "~1.0.9"
}
}
function either() {
foreach ( func_get_args() as $arg ){
if ( is_string( $arg ) ? !! trim( $arg ) : !! $arg ) {
return $arg;
}
}
return false;
}
@stryju
stryju / settings.json
Created September 24, 2013 13:06
sublime settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Dayle Rees Color Schemes/Peacock.tmTheme",
"default_line_ending": "unix",
"draw_minimap_border": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"flatland_sidebar_tree_small": true,
"flatland_square_tabs": false,
"folder_exclude_patterns":