Skip to content

Instantly share code, notes, and snippets.

View nitriques's full-sized avatar

Nicolas Brassard nitriques

View GitHub Profile
@nitriques
nitriques / gitlog.sh
Created March 7, 2014 21:45
Getting all logs from all git repos, in csv
rm -rf _gitlogs
mkdir _gitlogs
for D in *; do
if [ -d "${D}" ]; then
cd "${D}";
if [ -d ".git" ]; then
echo Date,Commit,Author,Projet,Comments > ../_gitlogs/"${D}.csv";
git log --format="%ai,%h,%an,${D},%s" --date=local >> ../_gitlogs/"${D}.csv";
fi
@nitriques
nitriques / .htaccess
Created May 6, 2014 15:38
Force download on Apache 2.2
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{QUERY_STRING} dl
RewriteRule ^.*\.(png|jpe?g|gif|pdf|rtf|txt|docx) - [T=applicaton/octet-stream,E=DOWNLOAD:true,L]
Header set Content-Disposition attachment env=DOWNLOAD
@nitriques
nitriques / fields.php
Last active August 29, 2015 14:03
Creating lot of fields in a Symphony section
<?php
// BOOTSTRAP SYMPHONY
define('DOCROOT', str_replace('/manifest', '', rtrim(dirname(__FILE__), '\\/') ));
define('VERBOSE', 1);
// section id
define('SOURCE', 41);
require_once(DOCROOT . '/symphony/lib/boot/bundle.php');
require_once(DOCROOT . '/symphony/lib/core/class.cacheable.php');
@nitriques
nitriques / jquery.md
Last active August 29, 2015 14:05
Docs for Symphony 2.5 - Migration from 2.4

Some of the jquery plugins shipped with 2.5 has been optimized for large sections (+100 fields) and also features and brand new jquery plugin: the affix plugin.

The optimization also brings new public events on the collapsible plugin:

  • updatesize.collapsible which will invalidate the cached values for the height of the DOM elements.
  • setsize.collapsible which will set the min and max height CSS properties based on the cached values.

If you develop a field that uses the collapsible plugin, feel free to trigger those events.

The new plugin, affix will make a element "sticky" on the page, in order to "follow" the scroll. This plugin is used in the section editor in order to make the Expand/Collapse button always visible.

@nitriques
nitriques / keybase.md
Created September 18, 2014 16:25
keybase.md

Keybase proof

I hereby claim:

  • I am nitriques on github.
  • I am nitriques (https://keybase.io/nitriques) on keybase.
  • I have a public key whose fingerprint is 3B2A 17E6 1D30 E5CE 9A4F BE0C 0A8E 9BA6 077B 3BE2

To claim this, I am signing this object:

@nitriques
nitriques / jquery.velocity.js
Last active August 29, 2015 14:10
Polyfill jQuery animations with Velocity
// polyfill jQuery animation engine
$.fn.animate = $.fn.velocity;
$.fn.fadeTo = function (duration, opacity, complete) {
return this.velocity({opacity: opacity}, { duration: duration, complete: complete });
};
$.fn.fadeIn = function (duration, complete) {
return this.velocity('fadeIn', { duration: duration, complete: complete });
};
$.fn.fadeOut = function (duration, complete) {
return this.velocity('fadeOut', { duration: duration, complete: complete });
@nitriques
nitriques / data.twitter.php
Created June 23, 2015 20:03
Twitter Remote Data Source for Symphony CMS
<?php
require_once(EXTENSIONS . '/remote_datasource/data-sources/datasource.remote.php');
Class datasourcetwitter extends RemoteDatasource {
public $dsParamROOTELEMENT = 'twitter';
public $dsParamURL = 'https://api.twitter.com/1.1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=ACCOUNT_NAME&count=10';
public $dsParamFORMAT = 'json';
public $dsParamXPATH = '/';
#!/bin/bash
git clone git@github.com:symphonycms/symphony-2.git bundle
cd bundle
git checkout bundle
cd extensions
pwd
git submodule init
git submodule update
echo ""
@nitriques
nitriques / memcached.sh
Last active November 19, 2015 16:24
Memcached on Centos 6
# php memcached
# from: http://stackoverflow.com/questions/24407095/error-when-installing-pecl-memcached/30898513#30898513
# Step 1 - Install SASL:
yum install cyrus-sasl-devel
# Step 2 - Compile libmemcached with SASL installed:
cd ~
@nitriques
nitriques / Chrome
Created May 8, 2013 17:11
Why chrome is not my best friend anymore...
Starting from version 26, Chrome as been making angry a lot...
Chrome
1. CSS3 animation are not as fluid as they used to be. IE10 is not more fluid than Chrome!
2. CSS3 gradiants are making the render glitchy: sometimes going under 5 FPS.
3. It seems like there is a problem with images cache: On the canvas, if you do not paint a image for one frame, then its cache gets deleted, which cause a performance problem (renders usually took 1 to 2 ms, but it jumps to 200 ms sometimes, and there's a blank in the devtools timeline. In the profile view, we only get (system) as feedback)
4. The video API throws errors when everything should be working fine. It plays the video only 50% of the time (even though it's the same video all the times)
5. Decoding images (especially base64 ones) is sometimes really slow, especially if the image is going in and out of the viewport (again, a image cache problem) ??