Skip to content

Instantly share code, notes, and snippets.

View JonathanZWhite's full-sized avatar
🦁

Jonathan White JonathanZWhite

🦁
View GitHub Profile
@ngokevin
ngokevin / bookmarklet
Created September 30, 2016 22:35
A-Frame/three.js 360-degree Screenshot Bookmarklet
javascript:(function(){var script=document.createElement('script');script.src='https://rawgit.com/AdaRoseEdwards/f6b96e4ea44c0201bc72879da62e633a/raw/9074d13fdbc540a0b4b578009c2fac79711359ba/equirectangular.js';document.body.appendChild(script);})();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
background-color: #ffffff;
margin: 0;
overflow: hidden;
}
@StefanWallin
StefanWallin / 1. Error message
Last active February 24, 2016 16:48
Including static images in React Native not working :(
Requiring unknown module "image!backdrop". If you are sure the module is there, try restarting the packager.
@sebmarkbage
sebmarkbage / Enhance.js
Last active February 10, 2025 06:23
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@ichord
ichord / gist:9808444
Created March 27, 2014 14:12
demo of using pdf.js to extract pages to images
<script src="http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing-api.min.js"></script><html>
<!--
Created using jsbin.com
Source can be edited via http://jsbin.com/pdfjs-helloworld-v2/8598/edit
-->
<body>
<canvas id="the-canvas" style="border:1px solid black"></canvas>
<input id='pdf' type='file'/>
<!-- Use latest PDF.js build from Github -->
@mariussoutier
mariussoutier / togglewatch.js
Last active August 13, 2018 23:55
Toggle an AngularJS $watch expression. The default $watch can only be toggled once.
var toggleWatch = function(watchExpr, fn) {
var watchFn;
return function() {
if (watchFn) {
watchFn();
watchFn = undefined;
console.log("Disabled " + watchExpr);
} else {
watchFn = $scope.$watch(watchExpr, fn);
console.log("Enabled " + watchExpr);
@alexkravets
alexkravets / video.coffee
Created May 22, 2013 05:55
Showdown extension for Youtube videos
#
# Youtube iFrame Extension
#
window.Showdown.extensions.video = (converter) ->
[
{
type : 'lang',
regex : '\\^\\^([\\S]+)',
replace : (match, url) ->
youtube = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/
@jeffrafter
jeffrafter / server.js
Created August 28, 2010 21:37
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {