Skip to content

Instantly share code, notes, and snippets.

@connrs
connrs / qsa-polyfill-ie7.js
Created May 18, 2012 09:49
IE7 querySelectorAll polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function(selector) {
var doc = document,
head = doc.documentElement.firstChild,
styleTag = doc.createElement('STYLE');
head.appendChild(styleTag);
doc.__qsaels = [];
styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}";
window.scrollBy(0, 0);
@r35krag0th
r35krag0th / Get-TLS-Fingerprint.sh
Created November 30, 2012 02:10
Get Pandora TLS Fingerprint
#!/bin/bash
##
## A simple little shell script that will return the current
## fingerprint on the SSL certificate. It's crude but works :D
##
## Author: Bob Saska (r35krag0th) <git@r35.net>
openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \
openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@SoniEx2
SoniEx2 / andif.md
Last active September 18, 2015 03:44

The andif Idea

[I might throw this one out. Scroll down for the orif idea]

Trivial use-case

Sometimes when you're coding you end up with things like this:

@g00glen00b
g00glen00b / style.css
Created February 7, 2017 12:57
Stack Overflow - New navigation bar dark theme
@-moz-document domain("stackoverflow.com") {
body.newheader {
padding-top: 0;
}
.so-header {
background-color: #333;
position: relative;
}
@cecilemuller
cecilemuller / launch.json
Last active July 22, 2024 05:49
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
@flukejones
flukejones / inheritance.rs
Last active February 21, 2019 21:40 — forked from MCluck90/inheritance.rs
Inheritance-like problem in Rust
/// Problem: there is a lot of duplication in function implementations.
/// The two types should have the same interface but use a different underlying type.
///
/// How can I reduce the amount of duplication and avoid having to update the code in two places?
/// In other languages, I would define a base class which accepts a generic type for the `SoundSource`s
/// but I don't know how to solve this sort of problem in Rust.
struct Sound {
// Shared properties
is_playing: bool,