Skip to content

Instantly share code, notes, and snippets.

@brettz9
brettz9 / DOMImplementation.prototype.createDocument.js
Created December 13, 2012 05:52
IE8 Shim for DOMImplementation.prototype.createDocument (does not support doctype argument nor wrap the resulting document to support all DOM methods and properties; mostly for loading XML)
/*globals DOMImplementation, ActiveXObject */
if (!DOMImplementation.prototype.createDocument) {
(function () {
'use strict';
var i, docObj, docObjType,
docObjs = [
'MSXML6.DOMDocument', 'MSXML5.DOMDocument', 'MSXML4.DOMDocument',
'MSXML3.DOMDocument', 'MSXML2.DOMDocument.5.0', 'MSXML2.DOMDocument.4.0',
@omeinusch
omeinusch / create-mysql.bash
Created August 31, 2013 11:50
Simple bash script to create mysql db, user with generated password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@rxaviers
rxaviers / gist:7360908
Last active July 23, 2024 09:43
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jnehlmeier
jnehlmeier / SuperDevModeUncaughtExceptionHandler.java
Created December 8, 2014 14:29
GWT: Clickable StackTrace in SDM
package de.carecloud.app.client.base.logging;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.UmbrellaException;
public class SuperDevModeUncaughtExceptionHandler implements GWT.UncaughtExceptionHandler {
@Override
public void onUncaughtException(final Throwable t) {
logException(t, false);
@k-barton
k-barton / remove-fb-tracking.user.js
Last active September 27, 2023 16:58
Greasemonkey user script: Remove Facebook's external link tracking
// ==UserScript==
// @name Remove Facebook's external link tracking
// @description Removes redirection and the "click identifier" from external links on FBs
// @namespace https://gist.github.com/k-barton
// @match https://*.facebook.com/*
// @version 0.3.7
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
(function() {
@jbgi
jbgi / Term.java
Last active September 25, 2023 00:45
Generalized Algebraic Data Types (GADT) in Java
import static java.lang.System.*;
import java.util.function.BiFunction;
import java.util.function.Function;
// Implementation of a pseudo-GADT in Java, translating the examples from
// http://www.cs.ox.ac.uk/ralf.hinze/publications/With.pdf
// The technique presented below is, in fact, just an encoding of a normal Algebraic Data Type
// using a variation of the visitor pattern + the application of the Yoneda lemma to make it
// isomorphic to the targeted 'GADT'.
import static java.lang.System.*;
import java.util.function.BiFunction;
import java.util.function.Function;
// Implementation of a pseudo-GADT in Java, translating the examples from
// http://www.cs.ox.ac.uk/ralf.hinze/publications/With.pdf
// The technique presented below is, in fact, just an encoding of a normal Algebraic Data Type
// using a variation of the visitor pattern + the application of the Yoneda lemma to make it
// isomorphic to the targeted 'GADT'.
@apangin
apangin / HotSpot JVM intrinsics
Last active July 20, 2024 10:43
HotSpot JVM intrinsics
_hashCode java/lang/Object.hashCode()I
_getClass java/lang/Object.getClass()Ljava/lang/Class;
_clone java/lang/Object.clone()Ljava/lang/Object;
_dabs java/lang/Math.abs(D)D
_dsin java/lang/Math.sin(D)D
_dcos java/lang/Math.cos(D)D
_dtan java/lang/Math.tan(D)D
_datan2 java/lang/Math.atan2(DD)D
_dsqrt java/lang/Math.sqrt(D)D
_dlog java/lang/Math.log(D)D
@5310
5310 / ._userstyles-fira-code
Last active September 23, 2021 09:39
Fira Code, and sexy ligatures! #theme #userstyle
Userstyles to the monospace fonts on certain sites and the Firefox Devtools, etc., to Fira Code.
I don't write userstyles very often, so these may not be particularly effecient or sensible. But at least they work. Corrections welcome!
Stylish of Firefox (at least) allows importing userstyles from arbitrary urls. It doesn't auto-update though, but mays till be easier than pasting by hand? :shrug: