Skip to content

Instantly share code, notes, and snippets.

View afalchi82's full-sized avatar

Alessandro Falchi afalchi82

View GitHub Profile
@afalchi82
afalchi82 / sameHeightElements.js
Last active September 9, 2015 16:02
Set same height for a collection of elements
(function () {
var fn = {
sameHeightCols: function () {
var throttled = _.throttle(init, 100);
function init() {
$('.row').each(function (i, e) {
@afalchi82
afalchi82 / angular.js
Created September 10, 2015 10:40
Notes about common AngularJS elements
/* -------------------------------------------
Service
--------------------------------------------*/
// Definizione
module.service('myService', function() {
this.browsers = ['Firefox', 'Chrome', 'Internet Explorer'];
});
// Implementazione
@afalchi82
afalchi82 / git.txt
Last active September 11, 2015 15:19
Git common operations summary
# Set your user name and email address
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
# Checking Your Settings
$ git config --list
# Clones a repository to your computer
# To grab a complete copy of another user's repository, use git clone like this:
@afalchi82
afalchi82 / DieHelvetica.js
Last active September 21, 2015 19:40
Kill Helvetica Neue
var fucker = 'helvetica neue',
allElementsArr = document.querySelectorAll('*');
for( var i=0; i < allElementsArr.length; i++ ) {
var element = allElementsArr[i],
fontStack = getComputedStyle(element)['font-family'].toLowerCase();
if( fontStack.indexOf(fucker) !== -1 ) {
var newStack = fontStack.replace(fucker, 'fuck');
@afalchi82
afalchi82 / addFlexSliderSlide.js
Created September 23, 2015 07:31
Add slide to FlexSlider 2
var s = $('.flexslider'),
// Clone another slide markup
newSlide = s.find('li').eq(0).clone()
// Change image source
.find('img').attr('src', 'http://www.awwwards.com/awards/submissions/2015/09/5601375a79570.jpeg')
// Return parent element
.end();
@afalchi82
afalchi82 / p.html
Last active September 25, 2015 08:42
Fast presenter
<!--
Copiare questo file nella cartella che contiene i file .jpg
Parametri:
f = Nome File (solo jpg, scritto senza estensione) [necessario]
bg = Codice esadecimale (senza #) [opzionale - default:#faf9f5]
w = Larghezza container (solo numeri) [opzionale - default:960px]
@afalchi82
afalchi82 / face-mosaic.markdown
Created September 17, 2017 09:41
Face mosaic