Skip to content

Instantly share code, notes, and snippets.

View juliend2's full-sized avatar

Julien Desrosiers juliend2

View GitHub Profile
@juliend2
juliend2 / .bash_profile
Created December 17, 2011 00:44
my .bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
export DROPBOXDIR="/Users/jdesrosiers/Dropbox"
# add bicycle's cli in the path
export PATH="$PATH:/Applications/XAMPP/htdocs/lib/bicycle/bin:$HOME/.local/bin"
@juliend2
juliend2 / get_icon_for_attachment.php
Created May 4, 2012 12:20
Return an icon image path for the given attachment ID
<?php
function get_icon_for_attachment($post_id) {
$base = get_template_directory_uri() . "/images/icons/";
$type = get_post_mime_type($post_id);
switch ($type) {
case 'image/jpeg':
case 'image/png':
case 'image/gif':
return $base . "image.png"; break;
@juliend2
juliend2 / gist:2820278
Created May 28, 2012 17:49
__() in javascript
window._lang = 'fr';
var translations = {
'String to Translate': 'Chaîne à traduire',
'something': 'quelque chose'
};
var __ = function(msgid) {
if (window._lang === 'fr' && (msgid in translations)) {
return translations[msgid];
def update_cakemail(user,nom,prenom,email,listid,postalcode)
#Find the user in the list to see if he already exist
findPars = CakeLibrary::CakeHash.new()
findPars['client_id'] = CLIENT_ID
findPars["user_key"] = user["user_key"].to_s
findPars["list_id"] = listid
findPars["limit"] = 1
findPars["offset"] = 0
findPars["query"] = '`email` LIKE "%' + email + '"'
res = CakeLibrary::CakeList.Search(findPars)
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Applications/XAMPP/htdocs/wp_fanclub"
ServerName fanclub.dev.eis5.com
ErrorLog "/Applications/XAMPP/logs/fanclub.localhost-error_log.txt"
CustomLog "/Applications/XAMPP/logs/fanclub.localhost-access_log.txt" common
<Directory "/Applications/XAMPP/xamppfiles/htdocs/wp_fanclub">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
@juliend2
juliend2 / gist:3409100
Created August 20, 2012 23:16
styles page for WP
Cette page montre tous les styles possibles dans ce blog.
<h1>Titre h1</h1>
<h2>Titre h2</h2>
<h3>Titre h3</h3>
<h4>Titre h4</h4>
<h5>Titre h5</h5>
<h6>Titre h6</h6>
Texte en <strong>Bold</strong>.
Texte en <em>Italique</em>. (NewsCycle ne comporte pas de variante italique)
@juliend2
juliend2 / gist:3557226
Created August 31, 2012 18:46
erreurs lors de l'installation
erreur lors du `sudo php bin/vendors install --reinstall`
remote: Total 11321 (delta 7529), reused 10747 (delta 7047)
Receiving objects: 100% (11321/11321), 1.43 MiB | 938 KiB/s, done.
Resolving deltas: 100% (7529/7529), done.
28d83c32e3dfcb0b3b6b4f16233cbe374b4d55a6
HEAD is now at cc4a6b1 Merge pull request #639 from widop/patch-1
sh: /var/www/poison14/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php: not found
PHP Fatal error: Class 'Sensio\Bundle\DistributionBundle\SensioDistributionBundle' not found in /var/www/poison14/app/AppKernel.php on line 29
@juliend2
juliend2 / gist:3670148
Created September 7, 2012 22:08
post category to body class
<body <?php
body_class(
join(' ',
wp_get_post_categories(
get_the_ID(),
array('fields'=>'slugs')
)
)
)
?>>
@juliend2
juliend2 / .slate
Created October 3, 2012 19:53
My slate config file
# Configs
# --------------------------------------------------
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Aliases
# --------------------------------------------------
alias push-full-screen push up bar-resize:screenSizeY | push right bar-resize:screenSizeX
alias push-full-screen-top throw 0 resize
@juliend2
juliend2 / gist:4131848
Created November 22, 2012 15:59
SQL queries
-- Tu peux mettre ceci pour avoir la liste de tous les annonceurs (ID et email):
SELECT DISTINCT u.ID, u.user_email
FROM `eswp_users` AS u, `eswp_usermeta` AS um
WHERE u.ID = um.user_ID
AND um.meta_key = 'eswp_capabilities'
AND um.meta_value LIKE '%job_lister%';
-- Pour avoir les membres (chercheurs d'emplois):