Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
focusing on ahoxus

Caue Rego cauerego

🎯
focusing on ahoxus
View GitHub Profile
View gist:1e6338d10d8c366e988170db1d875007
b0fc439d9981beaea63d55a2b0bf483d7ed8803f875d131fd128a85a84f2a11b8feb9b594c2af3ed1c424422fff1bbfe6311028caaaacfdb6884c13b3527d8b8
@cauerego
cauerego / kanagawa revised.lua
Last active Aug 13, 2017
tabletop kanagawa revised to work a bit better with the new tts version
View kanagawa revised.lua
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 Apr 24, 2017
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/
View print-reddit.js
// ==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 caue@cregox.com
// @grant none
// ==/UserScript==
View hofpo-ryanreynolds-funnydad-tweets.js
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 Feb 23, 2017
JS Bin google-hashcode2017-pizza // source https://jsbin.com/cadezov
View index.html
<!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>
View SETimeline.user.js
// ==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 May 30, 2021 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
View IndexedDB101.js
// 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 Mar 16, 2011
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 )
View example.html
<!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 Mar 16, 2011
fork from jsbin to randomize elements - try: http://jsbin.com/gist/873282#preview ( originally at http://jsbin.com/oyaxa/20/edit )
View example.html
<!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 Mar 16, 2011
postcode on jquery using the validate plugin - try: http://jsbin.com/gist/873257#preview ( originally at http://jsbin.com/ahufe4/3/edit )
View example.html
<!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