Skip to content

Instantly share code, notes, and snippets.

@jonjaques
jonjaques / index.html
Created August 2, 2013 19:08
Dream Mode
<script>
(function($) {
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
kkeys.push(e.keyCode);
if (kkeys.toString().indexOf(konami) >= 0) {
$(document).unbind('keydown', arguments.callee);
$.getScript('http://www.cornify.com/js/cornify.js', function() {
cornify_add();
$(document).keydown(cornify_add);
@jonjaques
jonjaques / checklist-serialize.js
Last active December 20, 2015 15:59
Serialize Confluence Checklists (like a boss)
(function() {
var els = $('#main-content').children().filter(function() {
var el = $(this);
return (el.is('h3') || el.is('h3 + ul')) ? true : false;
})
var queue = []
els.each(function() {
var el = $(this);
if (el.is('h3')) {
queue.push(el.text());
@jonjaques
jonjaques / dialog-reset.css
Last active December 22, 2015 04:18
jQuery UI Dialog Reset
.ui-dialog-reset.ui-dialog {
padding: 0;
}
.ui-dialog-reset.ui-dialog .ui-dialog-titlebar,
.ui-dialog-reset.ui-dialog .ui-dialog-content,
.ui-dialog-reset.ui-dialog .ui-dialog-buttonpane,
.ui-dialog-reset.ui-dialog .ui-dialog-buttonpane button,
.ui-dialog-reset.ui-dialog .ui-button-text {
padding: 0;
margin: 0;
var __extend = new Extender();
var Robot = function(robot) {
};
__extend( Robot.prototype, {
onIdle: function(e) {
var robot = e.robot;
@jonjaques
jonjaques / example.coffee
Last active August 29, 2015 13:57
Simple logging service (wraps $log) for Angular.js
app = angular.module 'demo', []
app.controller 'TestCtrl', ($scope, Logger)->
Logger.log 'generic log...' # generic log...
log = Logger.makeLogger 'TestCtrl'
log.log 'prefixed log' # TestCtrl: prefixed log
$scope.doStuff = ()->
def sass_literals(file_path)
engine = Sass::Engine.for_file(file_path, {})
environment = Sass::Environment.new
keyvals = []
engine.to_tree.children.each do |node|
next unless node.kind_of? Sass::Tree::VariableNode
if node.expr.kind_of? Sass::Script::Tree::Literal
value = node.expr.perform(environment)
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="bdr-app">
<template>
</template>
<script>
@jonjaques
jonjaques / node.webpack.ts
Created February 26, 2015 18:57
TypeScript definitions for webpack require()
// Type definitions for Node.js v0.11.13
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/************************************************
* *
* Node.js v0.11.13 API *
* *
************************************************/
/**
* redirect javascript bookmarklet
*/
// javascript:location.href='http://example.com/?uri='+encodeURIComponent(location.href)
/**
* bookmarklet loaded on site
*/
(function(){
@jonjaques
jonjaques / buttonselect.js
Created June 23, 2015 23:23
React Bootstrap ButtonGroup with Radio/Checkbox behavior
import React from 'react'
import { ButtonGroup } from 'react-bootstrap'
export default React.createClass({
propTypes: {
children: React.PropTypes.node,
type: React.PropTypes.oneOf(['checkbox', 'radio']),
value: React.PropTypes.any,
onChange: React.PropTypes.func,