Skip to content

Instantly share code, notes, and snippets.

View sveetch's full-sized avatar
🥝
I'm a kiwi

David THENON sveetch

🥝
I'm a kiwi
View GitHub Profile
@sveetch
sveetch / foundation5.3_bugfixes_backport_for_5.2.3.patch
Created June 17, 2014 21:13
Foundation 5.3 bugfixes backported to 5.2.3
--- foundation5/bower_components/foundation/scss/foundation/components/_global.scss
+++ foundation5/bower_components/foundation/scss/foundation/components/_global.scss.patch
@@ -11,8 +11,8 @@
// styles get applied to [data-mysite-plugin], etc
$namespace: false !default;
-// Control the inclusion of experimental properties
-$experimental: true !default;
+/*// Control the inclusion of experimental properties
+$experimental: true !default;*/
@sveetch
sveetch / analyzer.js
Last active August 29, 2015 14:03
Emencia Site Analyzer, a PhantomJS script to analyze webpages
/*
* Emencia Site Analyzer, a PhantomJS script
* (built with PhantomJS 1.9.7)
*
*
* Crawl pages from a flat sitemap from a JSON, each page is analyzed on the
* network traffic for its ressources and eventually report raised Javascript error
*
*
* - Take one required argument that is the filepath to a JSON file (called the
@sveetch
sveetch / template_lastmod.py
Created July 9, 2014 09:54
Get template file last modification
import os, datetime
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import find_template_loader
def get_template_lastmod_date(template_name):
"""
Get the last modification time of the used template, this probably work only
with filesystem and apps template loaders
@sveetch
sveetch / data_dependancies_djangocms-2.json
Last active August 29, 2015 14:10
Django datas dump script writer
[
["sites", {
"comments": "django.contrib.sites: standalone",
"use_natural_key": true,
"models": "sites"
}],
["auth", {
"comments": "django.contrib.auth [user and groups, no perms]: standalone",
"use_natural_key": true,
@sveetch
sveetch / tree.jquery.js
Last active August 29, 2015 14:17
Fixed jqTree
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function() {
var DragAndDropHandler, DragElement, HitAreasGenerator, Position, VisibleNodeIterator, node_module,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
node_module = require('./node');
Position = node_module.Position;
@sveetch
sveetch / watchit.py
Created April 21, 2015 17:09
Script to test watchdog
"""
Testing watchdog (mostly for OSX)
* Create a directory into your virtual environment, like "taiste";
* Go into this directory;
* Put this script into this directory;
* Run it with: python watchit.py
* Add files, edit files, remove files;
* See the logs if events are showed for changes you do previously on your files;
* Exit from the script when you are done using CTRL+C (or CMD+C on OSX);
@sveetch
sveetch / Gruntfile.js
Last active September 28, 2015 16:55
Asset management attempt with Gruntjs
/**
* Grunt config
*/
module.exports = function(grunt) {
var project_dir = 'project/',
static_dir = project_dir+'webapp_statics/',
asset_manifest = grunt.file.readJSON(project_dir+'assets.json'),
prepend_staticdir = function(file_map) {
for(var keyname in file_map){
var distkey = static_dir+keyname;
@sveetch
sveetch / toast.py
Created November 16, 2012 21:50
Testing a bug with webassets
"""
Usage with the following directory structure : ::
sources/
js/
css/
images/
_build/
static/
css/
@sveetch
sveetch / snapshot-responsive-models.js
Created November 26, 2012 21:34
A NodeJS script using PhantomJs to render some various screen resolution
/*
* A NodeJS script using PhantomJs to render some various screen resolution for a
* web page
*
* Developped with PhantomJs 1.7.0
*
* Script require two arguments :
*
* * The URL to snapshot;
* * The name of the snapshot, it will be suffixed with the used resolution and used as
@sveetch
sveetch / app.js
Last active December 9, 2015 09:16
MediaQuery watcher for Foundation5.4.x
/*
* Sample app Javascript initializer to demonstrate usage of 'mediaquery-watcher.jquery.js'
*/
$(document).ready(function($) {
// Init MediaQuery watcher
$('#watch-for-current-mquery').initCurrentMediaQuery();
$('#watch-for-current-mquery').watchForCurrentMediaQuery();
/*
* Initialize Foundation after all event is binded