Skip to content

Instantly share code, notes, and snippets.

View octavioturra's full-sized avatar

Octavio Turra octavioturra

View GitHub Profile
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ical.marudot.com//iCal Event Maker
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Sao_Paulo
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/America/Sao_Paulo
X-LIC-LOCATION:America/Sao_Paulo
BEGIN:STANDARD
@octavioturra
octavioturra / readme.txt
Created July 27, 2018 23:14
Sleeping Bear (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@octavioturra
octavioturra / beholder.js
Last active May 27, 2018 02:04
Hook for beholder events
const actions = {
LOAD: 'load',
NEXT: 'next',
UPDATE: 'update',
ERROR: 'error',
INTEGRAGE: 'integrate'
}
const steps = {
HOME: 'home',

Haskell


Para aprender algo novo, devemos esquecer conceitos antigos


IF

@octavioturra
octavioturra / toWorker.js
Last active August 26, 2016 18:50
function to load Workers on-the-fly
const getFunctionURL = (f) => URL.createObjectURL(new Blob(['(', f.toString(),')()'], {type: 'text/javascript'}));
const toWorker = (f) => new Worker(getFunctionURL);
const toServiceWorker = (f, opt = {}) => navigator.serviceWorker && navigator.serviceWorker.register(f, opt);

Validate data structure client-only

JWT

Generate the secret for the server; Uses secret to validate jwt with the structure;

If structure is valid, then, save data into the database;

Structure

@octavioturra
octavioturra / 3-global-state-snippets.md
Last active July 29, 2016 13:53
presentation about global state and 3 UI solutions

TypeScrypt + Angular

@Injectable()
export class AppService {
  value = 0;
  incrementState = () => Promise.resolve(this.value++);
}
@Component({
  selector: 'body',
  template: `
(ns aranaktu.locals)
(def api-key "")
(def auth-domain "aranaktu-3f89f.firebaseapp.com")
(def database-URL "https://aranaktu-3f89f.firebaseio.com")
(def storage-bucket "")
(def base-data {
:themes {
1 {
class Fetch {
create(store : object) {
if(!window.__fetch) {
window.__fetch = new Fetch()
}
Object.defineProperty(window.__fetch, 'state', {
get() {
return store.getState().login
}
});