Skip to content

Instantly share code, notes, and snippets.

View nitriques's full-sized avatar

Nicolas Brassard nitriques

View GitHub Profile
@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.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 / 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 / import.php
Created June 20, 2014 19:31
Importing data into Symphony-CMS from the command line
<?php
// You run it with php-cli
// i.e. php-cli import.php
// I usually run in on the server via ssh.
// I also usually put my scripts into manifest (to protect them from http access)
// This scripts imports data from a csv...
@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 / git-config.sh
Last active September 18, 2017 23:10
git config
git config --global user.email nitriques@users.noreply.github.com
git config --global help.autocorrect 1
git config --global color.ui 1
git config --global core.excludesfile ~/.gitignore_global
git config --global apply.whitespace "fix"
git config --global core.abbrev 10 # default is 7, linux uses 12, nodejs uses 10
git config --global rerere.enabled true
git config --global --add alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit"
@nitriques
nitriques / class.wordpresssql.php
Created March 14, 2014 13:58
Wordpress Data source for Symphony CMS
<?php
Abstract Class WordpressSqlDatasource extends Datasource {
public $dsParamREDIRECTONEMPTY = 'no';
public function __construct($env=NULL, $process_params=true){
parent::__construct($env, $process_params);
$this->_dependencies = array();
@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 / sync-starter-kit.sh
Last active March 16, 2018 22:54
sync-starter-kit.sh
#!/bin/bash
#function syncsk27 {
# pwd=`pwd`;
# cd /q;
# ./sync-starter-kit.2.7.sh $@;
# cd $pwd;
#}
VERSION=2.3.0
@nitriques
nitriques / top10.sh
Last active December 25, 2015 14:39
Find top 10 biggest directories
du -a / | sort -n -r | head -10