Skip to content

Instantly share code, notes, and snippets.

@jryans
jryans / .mozconfig
Last active August 29, 2015 14:10
Local Development with the Simulator
export CC="clang"
export CXX="clang++"
export CFLAGS="-fcolor-diagnostics"
export CXXFLAGS="-fcolor-diagnostics"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-firefox-release-b2g-desktop
mk_add_options AUTOCONF=autoconf213
ac_add_options --enable-application=b2g
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active February 25, 2025 22:27
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@padenot
padenot / index.html
Created December 5, 2014 23:32
Start of a test for setValueCurveAtTime
<script>
function lalaj() {
var out = document.querySelector("pre");
var a = new OfflineAudioContext(1, 44100, 44100);
var b = a.createBuffer(1, 44100, 44100);
var g = a.createGain();
var bb = b.getChannelData(0);
for (var i = 0; i < bb.length; i++) {
bb[i] = 1.0;
}
@joeblau
joeblau / OSX Secure Disk Wipe.md
Last active March 27, 2025 02:16
Securely erase an external disk using dd on OSX

Securely erase an external disk using dd on OSX

  1. Plug in your SD card, HDD, or other block device and then use the following command to see which /dev/diskN node it's located on:
diskutil list
  1. Unmount the disk where “N� is the number of the disk taken from the above command:
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@nphyx
nphyx / DataView_Uint24Accessors.js
Created September 14, 2015 06:25
Accessors for unsigned 24-bit ints on Javascript DataViews
/**
* Provide a 24 bit int implementation for DataViews. Note this
* causes two reads/writes per call, meaning it's going to be
* around half as fast as the native implementations.
*/
DataView.prototype.getUint24 = function(pos) {
return (this.getUint16(pos) << 8) + this.getUint8(pos+2);
}
DataView.prototype.setUint24 = function(pos, val) {
@paulirish
paulirish / what-forces-layout.md
Last active April 8, 2025 12:26
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
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Custom/fakeRefract" {
Properties {
}
@mmozeiko
mmozeiko / test.c
Last active April 28, 2024 20:52
gtk widget from x11 window
// gcc test.c `pkg-config --cflags --libs gtk+-3.0 gdk-3.0` -lX11 && ./a.out
#include <X11/Xlib.h>
#include <unistd.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
static void my_gtk_realize(GtkWidget* widget, gpointer user)
@jsantell
jsantell / web-ar-projects.md
Last active June 29, 2019 03:01
Projects for WebARonARKit and WebARonARCore

Projects for WebARonARKit and WebARonARCore

New Projects

Leave a comment to add a project you've created or found!

Browsers