Skip to content

Instantly share code, notes, and snippets.

@jdivock
jdivock / cheatin.js
Last active September 6, 2016 03:39
Cheatin at cookie clicker
const autoClickBig = () => {
const bigCookie = $('#bigCookie');
const bigClickInterval = setInterval(() => bigCookie.click(), 0);
}
// Vanilla auto-click golden
setInterval(() => {
const $shimmer = document.querySelector('div.shimmer');
$shimmer && $shimmer.click();
}, 1000)
@jdivock
jdivock / jqAnimPort
Created January 29, 2014 01:45
just the jquery animate code ported from 1.8 . . . hacked up to be used on a project where we're forced to use 1.7.2
var elemdisplay = {
BODY: "block"
}, curCSS, iframe, iframeDoc, cssExpand = ["Top", "Right", "Bottom", "Left"],
core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
cssPrefixes = ["Webkit", "O", "Moz", "ms"],
rnumsplit = new RegExp("^(" + core_pnum + ")(.*)$", "i"),
rnumnonpx = new RegExp("^(" + core_pnum + ")(?!px)[a-z%]+$", "i"),
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// Potential router.js
define([
'jquery',
'knockout',
'router',
'models/Order',
'models/VendorPortal'
], function($, ko, router, Order, VendorPortal) {
var vendorPortal = new VendorPortal().render();
@jdivock
jdivock / gist:7265284
Last active December 27, 2015 04:09
Knockout API - MOcean Ideally this will be put to use with some type of cascading router, with all required objects being created and rendered on page load, then being subsequently loaded and shown as their route is hit.
define([
'jquery',
'knockout',
'text!templates/orders/orderPlacements.html',
'bindings/orderPlacementsBindings'
], function($, ko, html, PlacementGrid) {
var Orders = function(params) {
// CONSTRUCTOR - START
@jdivock
jdivock / graphSnips.js
Last active October 2, 2015 20:57
graphql snippets
fragment JayFragment on Account {
email,
id
}
query UseFragment {
jay: account(id: 1) {
...JayFragment
}
}
// This doesn't work like you might think, because the value of `i` never
// gets locked in. Instead, every link, when clicked (well after the loop
// has finished executing), alerts the total number of elements, because
// that's what the value of `i` actually is at that point.
var elems = document.getElementsByTagName( 'a' );
for ( var i = 0; i < elems.length; i++ ) {
elems[ i ].addEventListener( 'click', function(e){
@jdivock
jdivock / 3colflexbox.html
Created August 9, 2015 21:21
3col flexbox
<html>
<head>
<style>
header {
height: 30px;
background: red;
}
article {
margin-left: 150px;
@jdivock
jdivock / 3colBasic.html
Created August 9, 2015 21:04
3Col CSS basic
<html>
<head>
<style>
header {
height: 30px;
background: red;
}
article {
margin-left: 150px;
@jdivock
jdivock / test.org
Last active August 29, 2015 14:22
test.org

evil-org-mode

Supplemental evil-mode key-bindings to Emacs org-mode. This is a work in progress, expect improvements and don’t be afraid to contribute patches.

Requirements

  • org-mode, git://repo.or.cz/org-mode.git
  • evil-mode, git://gitorious.org/evil/evil.git
  • evil-leader, git://github.com/cofi/evil-leader.git
@jdivock
jdivock / JSConf2015.org
Last active August 29, 2015 14:22
JSConf 2015

JSConf 2015

Day 1

Keynote

Oh, not a keynote, simple overview

Felipe de Albuquerque Accessibility and JS: side-by-side

Talk not in english

Trying new things!

this is weird