Skip to content

Instantly share code, notes, and snippets.

View legomushroom's full-sized avatar
🇺🇦
stop russizm

Oleg Solomko legomushroom

🇺🇦
stop russizm
View GitHub Profile
@WebReflection
WebReflection / Object.setPrototypeOf.js
Last active February 24, 2018 04:13
Object.setPrototypeOf(O, proto) full/complete polyfill with boolean flag for partial implementation.
/*jslint devel: true, indent: 2 */
// 15.2.3.2
if (!Object.setPrototypeOf) {
Object.setPrototypeOf = (function(Object, magic) {
'use strict';
var set;
function checkArgs(O, proto) {
if (typeof O !== 'object' || O === null) {
throw new TypeError('can not set prototype on a non-object');
}
/*
* Date Format 1.2.3
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
* MIT license
*
* Includes enhancements by Scott Trenda <scott.trenda.net>
* and Kris Kowal <cixar.com/~kris.kowal/>
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
(function(factory) {
if(typeof define === 'function' && define.amd) {
define(factory);
} else {
window.SpringJS = factory();
window.s = window.SpringJS;
}
})(function() {
@glslioadmin
glslioadmin / TEMPLATE.glsl
Last active July 5, 2019 00:55
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
void main() {
vec2 p = gl_FragCoord.xy / resolution.xy;
gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);
@developit
developit / hydra-alias.md
Last active February 27, 2020 01:54
Alias to invoke Chrome Canary w/ tracing, for IRHydra

An Alias to run Chrome with tracing enabled

For Chrome Canary:

alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'

For regular ol' Chrome:

@spite
spite / gist:93883bb7ad7de7b9bc62
Last active May 28, 2020 14:15
console.log for HTMLCanvasElement
/*
add this code
run console.log( canvas );
see the canvas
if the canvas is running a webgl context, it'll need the preserveDrawingBuffer flag set to true
*/
( function() {
@shinohai
shinohai / Nyan.sh
Created March 27, 2015 19:34
A Bash Nyan Cat For Fun
#!/bin/bash
# config
IMGS=(
"
+ o + o \n\
+ o + +\n\
o + \n\
o + + + \n\
+ o o + o\n\
@Chuxel
Chuxel / fix-bind-mount.sh
Last active October 14, 2020 17:32
Script to ensure using "docker -v" from the workspace folder functions in Codespaces
#!/bin/bash
if [ "${CODESPACES}" != "true" ]; then
echo 'Not in a codespace. Aborting.'
exit 0
fi
WORKSPACE_PATH_IN_CONTAINER=${1:-"$HOME/workspace"}
WORKSPACE_PATH_ON_HOST=${1:-"/var/lib/docker/vsonlinemount/workspace"}
VM_CONTAINER_WORKSPACE_PATH=/vm-host/$WORKSPACE_PATH_IN_CONTAINER
VM_CONTAINER_WORKSPACE_BASE_FOLDER=$(dirname $VM_CONTAINER_WORKSPACE_PATH)
@benatkin
benatkin / Global.sublime-settings
Created July 20, 2011 04:26
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
@novemberborn
novemberborn / setup.md
Created January 7, 2016 14:28
OS X Dnsmasq setup for .dev domains

Install dnsmasq using Homebrew. Edit the dnsmasq.conf file (Homebrew will tell you where to put it) to contain:

address=/.dev/127.0.0.1
listen-address=127.0.0.1

Then make sure Dnsmasq is running (again follow Homebrew instructions).

Create the /etc/resolver/dev directory (using root) if it doesn't exist yet and create a resolver for .dev: