Skip to content

Instantly share code, notes, and snippets.

@sdbruder
sdbruder / plot.awk
Created February 19, 2021 16:29 — forked from katef/plot.awk
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@sdbruder
sdbruder / question.js
Created July 18, 2018 01:24
question
function strUnhash(h)
{
str = "";
letters = "acdfgilmnoprstuw";
while(h>23) {
c = h % 23;
h = (h-(h%23))/23; // or a simpler Math.floor(h / 23) as h is always positive;
str = letters[c] + str;
}
@sdbruder
sdbruder / newlaravel.sh
Last active May 10, 2017 08:59
New Laravel Project from Scratch to working fresh install
#!/bin/bash
###
#
# newLaravelProject
#
# from an idea to a working freshly installed laravel in 26 seconds using
# composer create-project with prestissimo.
#
# Sergio Bruder <sergio@bruder.com.br>
@sdbruder
sdbruder / plex media player.log
Created October 21, 2015 17:58
Plex Media Player Log
^[^[[C2015-10-21 15:39:19 [ DEBUG ] InputKeyboard.h @ 23 - Input: "Return"
2015-10-21 15:39:19 [ DEBUG ] CachedRegexMatcher.cpp @ 29 - Found cached match for input: "Keyboard"
2015-10-21 15:39:19 [ DEBUG ] CachedRegexMatcher.cpp @ 29 - Found cached match for input: "Return"
2015-10-21 15:39:19 [ DEBUG ] InputMapping.cpp @ 68 - Mapped: "Return" to action: "enter"
2015-10-21 15:39:19 [ DEBUG ] InputComponent.cpp @ 96 - Sending action: "enter"
2015-10-21 15:39:20 [ DEBUG ] InputKeyboard.h @ 23 - Input: "Return"
2015-10-21 15:39:20 [ DEBUG ] CachedRegexMatcher.cpp @ 29 - Found cached match for input: "Keyboard"
2015-10-21 15:39:20 [ DEBUG ] CachedRegexMatcher.cpp @ 29 - Found cached match for input: "Return"
2015-10-21 15:39:20 [ DEBUG ] InputMapping.cpp @ 68 - Mapped: "Return" to action: "enter"
@sdbruder
sdbruder / 0_reuse_code.js
Created February 25, 2014 14:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// ==UserScript==
// @name remove folha's paywall
// @namespace http://folha.uol.com.br/
// @version 0.1
// @description just remove folha's paywall
// @include http://*.folha*/*
// @match http://*.folha*/*
// @include http://*.blogfolha*/*
// @match http://*.blogfolha*/*
// @copyright 2012+, Me
<div class="<?php echo $form->fieldClass($model, 'vehicle_fuel_type'); ?>">
<?php echo $form->labelEx($model,'vehicle_fuel_type'); ?>
<div class="input">
<?php echo $form->dropDownList($model,'vehicle_fuel_type',
array('GA'=>'Gasolina',
'AL'=>'Álcool',
'DI'=>'Diesel',
'GN'=>'Gás Natural',
'EL'=>'Eletricidade',
),