Skip to content

Instantly share code, notes, and snippets.

View gastonambrogi's full-sized avatar
🌱
Growing

Gastón Ambrogi gastonambrogi

🌱
Growing
  • Freelancer Frontend Developer
  • Buenos Aires, Argentina
  • 02:14 (UTC -03:00)
  • X @gastonambrogi
View GitHub Profile
@gastonambrogi
gastonambrogi / concat_json.js
Created December 5, 2016 12:30
Concat JSON files into one to use in json-server
const fs = require('fs');
let files = fs.readdirSync('.').filter((file) => { return file.includes('.json') && file !== 'db.json' });
let concat={};
files.forEach(function(file){
let fileContent=fs.readFileSync(file, 'utf8');
concat[file.split('.json')[0]]=JSON.parse(fileContent);
})
@gastonambrogi
gastonambrogi / component.ts
Last active December 19, 2016 18:15
bootstrap toggle button for angular 2
import {Component, Pipe, PipeTransform} from 'angular2/core';
import {CORE_DIRECTIVES, ngClass, NgClass, FORM_DIRECTIVES, Control, ControlGroup, FormBuilder, Validators} from 'angular2/common';
@Component({
selector: 'my-app',
templateUrl: 'mytemplate.html',
directives: [CORE_DIRECTIVES, FORM_DIRECTIVES],
styleUrls: ['style.css']
})
export class AppComponent {
@gastonambrogi
gastonambrogi / shimmer.html
Created December 20, 2016 11:50
Shimmer CSS - Shimmer effect
<h1 class="shimmer">Some Shimmer Text</h1>
<style>
@import url('http://fonts.googleapis.com/css?family=Alegreya+Sans:300');
body{
background: #000;
}
.shimmer{
/* styling stuff */
font-family:"Alegreya Sans";
@gastonambrogi
gastonambrogi / gitflow-breakdown.md
Last active April 7, 2017 18:25 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@gastonambrogi
gastonambrogi / blur.css
Created February 9, 2017 20:41
Blurring
img {
filter: blur(10px);
transform: scale(1.5);
overflow: hidden;
}
@gastonambrogi
gastonambrogi / retrieve-last-commit-id.sh
Created February 9, 2017 20:47
Retrieve the last commit id in HEAD on current branch
git rev-parse HEAD
@gastonambrogi
gastonambrogi / parseFloat.js
Created March 21, 2017 12:29
Parse JS float without presicion error (.0000...1)
parseFloat(number.toFixed(2))
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough [email protected]
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@gastonambrogi
gastonambrogi / pnoise.py
Last active April 9, 2017 21:03
Perlin Noise
import random
import math
from PIL import Image
"""
Extracted from http://gamedev.stackexchange.com/questions/23625/how-do-you-generate-tileable-perlin-noise
"""
perm = range(256)
random.shuffle(perm)
perm += perm
i3 Window Manager
Open terminal: $mod+Enter
Split window vertically: $mod+v command
Split window horizontally: $mod+h command
Change window focus: $mod+arrow-keys
Move focused windows: $mod+Shift+arrow-keys
Toggle splith/splitv: $mod+e
Switch to stacking mode: $mod+s
Switch to tabbed mode: $mod+w