Skip to content

Instantly share code, notes, and snippets.

View christian-fei's full-sized avatar

Christian christian-fei

View GitHub Profile
@christian-fei
christian-fei / gist:7747009
Last active December 30, 2015 00:08
minimal grid system
*, *:before, *:after{
margin: 0;
padding: 0;
box-sizing:border-box;
}
.row{
width: 100%;
overflow: hidden;
}
.row > *{
@christian-fei
christian-fei / gist:8059769
Last active December 31, 2015 23:28
node autodidact ftw
http://book.mixu.net/node/
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#nodejs
http://nodeschool.io/
https://github.com/rvagg/learnyounode
UPDATE
wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
tar xzf node-v0.10.24.tar.gz
cd node-v0.10.24/
./configure && sudo make && sudo make install
#non necessario
@christian-fei
christian-fei / gist:8281582
Created January 6, 2014 11:36
Hey Kevin, I read you post about jekyll and bullgit. You mentioned you got the response twice when doing the xmlhttprequest. It may be because your are not 'waiting long enough'. Maybe (certainly) the code below explains it better
var xml = new XMLHttpRequest();
//async, coz Ajax
xml.open("GET", "https://api.github.com/orgs/bullgit/repos", true);
xml.onreadystatechange = function() {
//see this link for more info about readyState http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp
if (xml.status==200 && xml.readyState==4){
//your code
}
};
xml.send();
/*
domanda
+risposte*5
*/
var domande = document.querySelectorAll('.domanda');
function submitAllowed(){
var ret=true;
for( domanda in domande){
if(ret===false){
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
@christian-fei
christian-fei / gist:8493137
Created January 18, 2014 16:58
the command works just fine on my setup but when issuing the command with grunt it gives me a strange error
task :m do
sh "METEOR=Y MONGO_URL=mongodb://localhost:27017/statscf meteor --port 3010"
exit
end
and when i do `rake m` I get:
METEOR=Y MONGO_URL=mongodb://localhost:27017/statscf meteor --port 3010
rake aborted!
@christian-fei
christian-fei / install.sh
Last active August 29, 2015 13:55
restore essential programs/tools for my setup
update() {
sudo apt-get update
}
chrome() {
echo "######INSTALLING GOOGLE CHROME"
cd ~/downloads
wget -v https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O gc.deb
sudo apt-get install libxss1
sudo dpkg -i gc.deb
rm gc.deb
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
(function(){
var app = angular.module('store', []);
app.controller('StoreController', ['$scope', '$http', function($scope, $http) {
$scope.products = [];
$http.get('https://api.github.com/users/christian-fei/repos').success(function(data) {
console.log(data);
$scope.products = data;
});
}]);