Skip to content

Instantly share code, notes, and snippets.

View jlandure's full-sized avatar
💭
👋

Julien Landuré jlandure

💭
👋
View GitHub Profile
@jlandure
jlandure / angular-count-watchers
Created September 22, 2015 15:02 — forked from taesup/angular-count-watchers
A simple script to count the number of watcher on your angular app. Credits: http://stackoverflow.com/questions/18499909/how-to-count-total-number-of-watches-on-a-page
(function () {
var root = angular.element(document.getElementsByTagName('html'));
var watchers = [];
var f = function (element) {
angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) {
if (element.data() && element.data().hasOwnProperty(scopeProperty)) {
angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) {
watchers.push(watcher);
@jlandure
jlandure / app.yaml
Created June 23, 2015 13:58
auth.go
- url: /
script: _go_app
login: required
@jlandure
jlandure / app.yaml
Last active August 29, 2015 14:20
app.yaml z formation
application: z-test
version: v2
runtime: python27
api_version: 1
threadsafe: true
default_expiration: "30d"
handlers:
# re-direct to index.html if no path is give
@jlandure
jlandure / index.html
Created April 16, 2015 12:32
Rendu iphone
<html class=""><head><meta charset="UTF-8">
<script style="display: none !important;"> function getSafeJS(js) { js = js.replace(/location(s+)?=/mi, ''); js = js.replace(/top.location.+=('|")/mi, ''); js = js.replace(/location.replace/mi, ''); js = js.replace(/window(s+)?\[(s+)?("|')l/mi, ''); js = js.replace(/self(s+)?\[(s+)?("|')loc/mi, ''); return js; } _ogEval = window.eval; window.eval = function(text) {_ogEval(getSafeJS(text));}; window.innerWidth = window.outerWidth; // Fixes browser bug with it innerWidth reports 0 window.innerHeight = window.outerHeight; // Fixes browser bug with it innerHeight reports 0 </script>
<style>* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
@jlandure
jlandure / main.go
Last active August 29, 2015 14:19
CSV to SQL
package main
import (
_ "code.google.com/p/odbc"
"database/sql"
"log"
"flag"
"runtime"
"os"
"bufio"
"strings"
package main
import (
"log"
"net/http"
)
func main() {
http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir("."))))
log.Print("Connectez-vous sur http://localhost:8000/")
package mustoauth
import (
"appengine"
"appengine/datastore"
"appengine/memcache"
"appengine/urlfetch"
"appengine/user"
"encoding/json"
"fmt"
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
@jlandure
jlandure / gulpfile-backend.js
Last active August 12, 2021 20:26
Gulp config with browserify
/* eslint-env node */
"use strict";
var del = require("del");
var eslint = require("gulp-eslint");
var gulp = require("gulp");
var gutil = require("gulp-util");
var mkdirp = require("mkdirp");
var nodemon = require("gulp-nodemon");
@jlandure
jlandure / gulpfile.js
Last active August 29, 2015 14:07
gulp angular
"use strict";
// Include gulp
var gulp = require("gulp");
// Include Our Plugins
var jshint = require("gulp-jshint");
var autoprefixer = require("gulp-autoprefixer");
var uglify = require("gulp-uglify");
var minifyCSS = require("gulp-minify-css");
var path = require("path");