Skip to content

Instantly share code, notes, and snippets.

View mateusvahl's full-sized avatar
🏠
Working from home

Mateus Vahl mateusvahl

🏠
Working from home
View GitHub Profile
@mateusvahl
mateusvahl / Txt
Created June 1, 2016 03:11
Handlebars
Writes a new render engine:
{(yields}} can be implemented with helpers.
{{content_for}} and {{output_for}} can be implemented with helpers and state.
{{docs}} can be implemented with helpers+state+blocks, also use handlebars to output default cars in doc.
{{metadata}} can be implemented with helpers in a before render step.
{{lorem 1000}} writes 1000 lines of lorem ipsum
final step: check for patterns not used
(scope "/"
(scope "admin"
(scope "/user"
(get "index" 'index-controller))))
->
(get "/admin/user/index")
// Logged User can access they feed
var LoggedUser = {
neewsFeed: function() {
console.log('/feed');
// return redirect('/feed')
}
}
// Let's represent the absence of an credential user
// https://en.wikipedia.org/wiki/Null_Object_pattern
@mateusvahl
mateusvahl / HighCotrastJS.js
Created February 26, 2016 19:28
High Cotrast JS
function parseBackground($element) {
var css = $element.css('background-color');
if (!css || (css == 'rgba(0, 0, 0, 0)' || css == 'transparent')) {
return;
}
$element.css('background-color', 'black');
}
function parseColor($element) {
"Computer scientists do not know their history...we think everything is new in our field, but in reality, most things are really old, and they are invented or discovered by mathematicians" - Dr. Erik Meijer
sudo apt-get install libgl1-mesa-dev x11proto-xf86dri-dev libgcrypt11-dev x11proto-xcmisc-dev x11proto-randr-dev x11proto-render-dev x11proto-video-dev libxfont-dev x11proto-composite-dev x11proto-scrnsaver-dev libxkbfile-dev x11proto-xinerama-dev x11proto-resource-dev x11proto-record-dev x11proto-bigreqs-dev
sudo apt-get install gstreamer1.0-plugins-bad gstreamer1.0-fluendo-mp3 gstreamer1.0-plugins-ugly
@mateusvahl
mateusvahl / gist:2711e8d73f53bda480dc
Created May 8, 2015 22:58
linux npm install without sudo
npm config set prefix '~/.npm-packages'
echo 'export PATH="$PATH:$HOME/.npm-packages/bin"' >> ~/.bashrc
sudo apt-get install libgl1-mesa-dri-lts-trusty:i386 libgl1-mesa-glx-lts-trusty:i386 libc6:i386