Skip to content

Instantly share code, notes, and snippets.

View anonyco's full-sized avatar
🐕
I really like dogs. They are so fun to play with, simple to care for, and cute.

Jack anonyco

🐕
I really like dogs. They are so fun to play with, simple to care for, and cute.
  • United States
View GitHub Profile
@Efreak
Efreak / Chrome Incognito Handler.reg
Last active June 9, 2021 03:54
Registers Google Chrome with windows (again) as a URL and filetype handler--but in incognito mode. If you choose 'Google Chrome Incognito' as a file/url handler, then your files/urls will open in incognito mode. You may wish to adjust the paths listed below if you don't have chrome installed in the standard location, or if you use dev or canary …
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ChromeIncognitoHTML]
@="Chrome Incognito HTML Document"
"AppUserModelId"="ChromeIncognito"
[HKEY_CLASSES_ROOT\ChromeIncognitoHTML\Application]
"AppUserModelId"="ChromeIncognito"
"ApplicationIcon"="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe,0"
"ApplicationName"="Google Chrome Incognito"
@yurydelendik
yurydelendik / !wasmllvm.md
Last active February 23, 2024 05:08
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@paulirish
paulirish / what-forces-layout.md
Last active May 19, 2024 03:45
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
@wilsonpage
wilsonpage / storage.js
Created September 11, 2015 14:25
Simple localStorage like wrapper around indexeddb
function Storage(name) {
this.ready = new Promise((resolve, reject) => {
var request = window.indexedDB.open(location.origin);
request.onupgradeneeded = e => {
this.db = e.target.result;
this.db.createObjectStore('store');
};
request.onsuccess = e => {
@nolanlawson
nolanlawson / readme.md
Last active September 12, 2022 19:40
What's missing in Microsoft's implementation of IndexedDB

What's missing in Microsoft's implementation of IndexedDB

Per a discussion with Christian Heilmann, I've put together a little doc outlining the current IndexedDB issues in IE 10-11 and Edge.

Major blockers

The biggest issue with IE's implementation is the lack of multiEntry, complex keys, or compound keypaths. Kyaw Tun (creator of YDN-DB) has grumbled a lot about this, and David Fahlander (Dexie.js creator) has written a heroic polyfill called IEGap that adds the missing behavior. (Although per David, it passes the W3C tests but not all the Dexie tests due to some tricky edge cases.)

@rauschma
rauschma / PreventUnknownGet.js
Last active August 12, 2021 16:07
Prevent getting of unknown properties via ES6 proxies
// The following code is valid ECMAScript 6, but doesn’t work in Firefox, yet
function PreventUnknownGet() {
}
PreventUnknownGet.prototype = new Proxy(Object.prototype, {
get(target, propertyKey, receiver) {
if (!(propertyKey in target)) {
throw new TypeError('Unknown property: '+propertyKey);
}
// Make sure we don’t block access to Object.prototype
@ranacseruet
ranacseruet / VideoStream.php
Last active April 14, 2024 12:42
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@Yaffle
Yaffle / TextEncoderTextDecoder.js
Last active February 21, 2024 18:27
TextEncoder/TextDecoder polyfills for utf-8
// TextEncoder/TextDecoder polyfills for utf-8 - an implementation of TextEncoder/TextDecoder APIs
// Written in 2013 by Viktor Mukhachev <vic99999@yandex.ru>
// To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
// You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
// Some important notes about the polyfill below:
// Native TextEncoder/TextDecoder implementation is overwritten
// String.prototype.codePointAt polyfill not included, as well as String.fromCodePoint
// TextEncoder.prototype.encode returns a regular array instead of Uint8Array
// No options (fatal of the TextDecoder constructor and stream of the TextDecoder.prototype.decode method) are supported.
@papucho
papucho / file.html
Created April 18, 2013 20:59
Grayscale filter using SVG+CSS
<img src="http://lorempixel.com/400/200/sports/" alt="" class="fader">
<?php
class ProcessInfo {
/** @var array $processes */
protected $processes = array();
/**
* Find a processes
*