This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for directory in $(ls) | |
do | |
echo Move to $directory; | |
cd $directory && zip $directory * && cd .. && mv $directory/$directory.zip . || echo Erro meine cheneral; | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get a value from an object by its path | |
* @param {Object} obj | |
* @param {String} path Path to the value key1.key2.key3... | |
* @return {Object} Value | |
*/ | |
function valuePathObject(obj, path) { | |
path.split(".").forEach(function(item){ | |
obj = obj[item] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Without # | |
list($r,$g,$b) = sscanf($color, "%02x%02x%02x"); | |
// With # | |
list($r,$g,$b) = sscanf($color, "#%02x%02x%02x"); | |
// from http://stackoverflow.com/questions/15202079/convert-hex-color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Concatenate your partials and append them to index.html | |
gulp.task('templates', function() { | |
var stream = streamqueue({objectMode: true}); | |
stream.queue(gulp.src([ | |
'./src/layout/header.html', | |
'./src/layout/body.html' | |
])); | |
stream.queue(gulp.src('./src/partials/**/*.html').pipe(partials())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fichier dans le dossier task pour le cas deux | |
var gulp = require('gulp'), | |
concat = require("gulp-concat") | |
es = require('event-stream') | |
partials = require('gulp-partial-to-script') | |
streamqueue = require('streamqueue'); | |
module.exports = function() { | |
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ça casse que si je relance gulp. | |
ìf(cartList.models.length) { | |
generator(cartList.models,0,cartList.models.length); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* i18nLoad directive | |
* Load a translation from a click on a button with the attr i18n-load | |
*/ | |
module.exports = ['localize', function(localize) { | |
return { | |
restrict: "A", | |
link: function(scope,el,attr) { | |
el.on('click',function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
watchify = require("watchify"), | |
concat = require("gulp-concat"), | |
streamqueue = require('streamqueue'), | |
streamify = require('gulp-streamify'), | |
source = require('vinyl-source-stream'), | |
livereload = require('gulp-livereload'); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function padNumber(n, pad) { | |
var str = '' + n; | |
return '000000000'.slice(str.length,pad) + str; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doRequest(url, cb) { | |
// create the request here | |
cb = cb || function(){}; | |
var xhr = new XMLHttpRequest(); | |
var requestUrl = url; | |
xhr.open("GET", requestUrl, true); | |
xhr.onreadystatechange = function() { | |
var status; |
OlderNewer