Skip to content

Instantly share code, notes, and snippets.

View cauerego's full-sized avatar
🎯
focusing on ahoxus

c+aue cauerego

🎯
focusing on ahoxus
View GitHub Profile
b0fc439d9981beaea63d55a2b0bf483d7ed8803f875d131fd128a85a84f2a11b8feb9b594c2af3ed1c424422fff1bbfe6311028caaaacfdb6884c13b3527d8b8
@cauerego
cauerego / kanagawa revised.lua
Last active August 13, 2017 10:29
tabletop kanagawa revised to work a bit better with the new tts version
guids = {
start_button = 'ef8989',
lesson_deck = '7c44e3',
starting_tile_bag = '931537',
zone_lessons_1 = 'd6b214',
zone_lessons_2 = '8bd9fb',
zone_lessons_3 = '72c9f5',
zone_column_1 = 'be1644',
@cauerego
cauerego / print-reddit.js
Last active April 24, 2017 01:22
a few new buttons for reddit: prepare page for printing (or saving) in a better reading streamable format, open all comments and remove side bar. made for http://tampermonkey.net/
// ==UserScript==
// @name print reddit
// @namespace reddit
// @include http*//*reddit.com/*
// @version 0.1
// @description a few new buttons for reddit: prepare page for printing (or saving) in a better reading streamable format, open all comments and remove side bar.
// @author [email protected]
// @grant none
// ==/UserScript==
Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
}
var times = [];
document.querySelectorAll('twitterwidget').forEach( elem => {
let e = elem.shadowRoot.querySelector('time').textContent
let m = e.match(/-.*?([^\d\s]+)/)[1]
let d = Number(e.match(/-.*?([\d]+)/)[1]).pad(2)
@cauerego
cauerego / index.html
Created February 23, 2017 12:36
JS Bin google-hashcode2017-pizza // source https://jsbin.com/cadezov
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="google-hashcode2017-pizza">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
// ==UserScript==
// @name Stack Exchange Timeline Link
// @namespace stackoverflow
// @description Add a 'timeline' link to Stack Exchange / Stack Overflow posts - based on http://stackapps.com/questions/2047/add-timeline-and-revisions-links/4238#4238
// @include http*//*stackexchange.com/*
// @include http*//*stackoverflow.com/*
// @include http*//*serverfault.com/*
// @include http*//*superuser.com/*
// @include http*//*askubuntu.com/*
// @include http*//*mathoverflow.net/*
@cauerego
cauerego / IndexedDB101.js
Last active January 13, 2023 22:00 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
// quite untested, adapted from BigstickCarpet's gist, attempt to make it simpler to use
function openIndexedDB (fileindex) {
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
var openDB = indexedDB.open("MyDatabase", 1);
openDB.onupgradeneeded = function() {
var db = {}
@cauerego
cauerego / example.html
Created March 16, 2011 21:08
jquery validate CPF, a brazilian document equivalent to social security - try: http://jsbin.com/gist/873308#preview ( originally at http://jsbin.com/agida4/16/edit )
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"></script>
<script src="jquery.validate.cpf.js"></script>
<script type="text/javascript">
$(function () {
var $cpf = $("#id_cpf").attr("name");
var $params = {debug:false, rules:{}, messages:{}};
@cauerego
cauerego / example.html
Created March 16, 2011 20:55
fork from jsbin to randomize elements - try: http://jsbin.com/gist/873282#preview ( originally at http://jsbin.com/oyaxa/20/edit )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="jquery.randomize.js"></script>
<title>Sandbox</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { background-color: #000; font: 16px Helvetica, Arial; color: #fff; }
@cauerego
cauerego / example.html
Created March 16, 2011 20:42
postcode on jquery using the validate plugin - try: http://jsbin.com/gist/873257#preview ( originally at http://jsbin.com/ahufe4/3/edit )
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
<script class="jsbin" src="http://rez.googlecode.com/svn-history/r250/trunk/libs/jquery.maskedinput-1.2.2.min.js"></script>
<script src="jquery.validate.postcode.js"></scrip>
<script type="text/javascript">
$(function () {
$("#postcode").mask("?99999-999", {placeholder: " "}) // Codigo Endereco Postal - CEP from Brazil