Skip to content

Instantly share code, notes, and snippets.

View pera's full-sized avatar
⚠️
moved to: https://gitlab.com/trobador

Brian Gomes Bascoy pera

⚠️
moved to: https://gitlab.com/trobador
View GitHub Profile
@pera
pera / gist:1088029
Created July 17, 2011 20:31
Resolvente para calculadora HP 35s
** Discriminant **
D001 LBL D
D002 RCL B
D003 x²
D004 4
D005 RCL A
D006 RCL C
D007 *
D008 *
@pera
pera / rtti
Created November 26, 2011 01:10
typeid del hijo desde el constructor del padre
#include <iostream>
#include <typeinfo>
class Foo {
private:
const std::type_info &info;
public:
Foo(const std::type_info &i):info(i){pepe(info);}
void pepe(const std::type_info &info){std::cout << info.name() << "__\n";}
};
@pera
pera / hsv.glsl
Created March 12, 2012 22:40
rainbow :3
float s = gl_TexCoord[0].s;
//sine
gl_FragColor.rgb = clamp(vec3(cos(s*pi*2)+0.5,cos(s*pi*2-pi*(2.0/3.0))+0.5,cos(s*pi*2+pi*(2.0/3))+0.5),0,1)*gl_TexCoord[0].t;
//linear
gl_FragColor.rgb = clamp(vec3(abs(6*s-3)-1,2-abs(6*s-2),2-abs(6*s-4)),0,1)*gl_TexCoord[0].t;
@pera
pera / gist:2624765
Created May 6, 2012 22:02
Improve move speed on Vim
" Improve move speed
let g:boostmove=0
set updatetime=500
au CursorMoved * call BoostMoveON()
au CursorMovedI * call BoostMoveON()
au CursorHold * call BoostMoveOFF()
au CursorHoldI * call BoostMoveOFF()
function BoostMoveON()
if (winline() != line('$')) && (line('.') != 1)
if (winline() == winheight('.')) || (winline() == 1)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Pseudo-fluid</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
@pera
pera / .bashrc
Last active April 22, 2018 20:07
alias cat="cat -v"
alias ls="ls -AF --color"
alias rm="rm -I"
alias mv="mv -i"
alias cp="cp -i"
alias less="less -iR"
alias grep="grep --color=auto -n"
alias g="grep -ri"
alias f="find|`which grep` --color=auto -Pi"
alias df="df -h"
@pera
pera / gist:7579603
Last active December 28, 2015 23:29
golfday/s
print "$_ day",do{'s' if $_!=1} for int(2.2);
print "$_ day",$_==1?'':'s' for int(2.2);
print"$_ day".'s'x!!($_-1)for int 2.2;
print"$_ day",$_-1?'s':''for int 2.2;
my $foo = map{"$_ day".($_-1?'s':'')}int 2.2;
@pera
pera / gist:7970159
Last active December 31, 2015 09:59
FizzBuzz
print+(join'',("FizzBuzz"=~/./g)[$_**2%3*4..7-$_**4%5*4])||$_,$/for 1..100;
print+($_,'Fizz','Buzz','FizzBuzz')[!($_%3)|!($_%5)<<1].$/for 1..100;
print+($_,'Fizz','Buzz','FizzBuzz')[!($_%3)+!($_%5)*2].$/for 1..100;
print+($_%15?$_%5?$_%3?$_:'Fizz':'Buzz':'FizzBuzz').$/for 1..100;
print+('Fizz')[$_%3].('Buzz')[$_%5]||$_,$/for 1..100; #it may give warnings
@pera
pera / syslinux.cfg
Created January 7, 2014 01:13
black menu
UI vesamenu.c32
# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
MENU TITLE Arch Linux
MENU COLOR border 30;44 #40ffffff #a0000000 std
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
MENU COLOR help 37;40 #c0ffffff #a0000000 std
@pera
pera / .ghci
Last active November 3, 2017 13:01
GHCi dot file
-- You need to install IPPrint and HsColour with cabal to use this config.
-- If you find all the loading messages anoying you may want to set an alias:
-- alias ghci="ghci -v0"
-- Or if you are using stack ghci:
-- alias ghci="stack --silent ghci --ghci-options -v0"
:set -XNoMonomorphismRestriction
:set prompt "\ESC[34mλ\ESC[m "
-- remove the following comments if ghci >= v7.8.1 for multiline support: