Skip to content

Instantly share code, notes, and snippets.

Julien Charette juliencharette

  • Canada School of Public Service
  • Gatineau, QC
Block or report user

Report or block juliencharette

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@juliencharette
juliencharette / CraftLocalizedValetDriver.php
Created Jun 20, 2017
Craft Localized Valet Driver (en|fr)
View CraftLocalizedValetDriver.php
<?php
class CraftLocalizedValetDriver extends ValetDriver {
public function serves($sitePath, $siteName, $uri) {
return is_dir($sitePath . '/craft');
}
public function isStaticFile($sitePath, $siteName, $uri) {
if (file_exists($staticFilePath = $sitePath . '/public/' . $uri)) {
@juliencharette
juliencharette / extensions.js
Last active Oct 4, 2016
Laravel-Elixir Imagemin)
View extensions.js
// Extensions.js
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
var cached = require('gulp-cached');
var pngquant = require('imagemin-pngquant');
var Elixir = require('laravel-elixir');
var Task = Elixir.Task;
@juliencharette
juliencharette / CraftLocaleValetDriver.php
Last active Aug 26, 2016
Craft Valet Driver for localized site. Copy to ~/.valet/Drivers folder.
View CraftLocaleValetDriver.php
<?php
class CraftLocaleValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
View babel-browserify-gulpfile.js
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('rimraf');
var runSequence = require('run-sequence');
var browserify = require('browserify');
var babelify = require('babelify');
var watchify = require('watchify');
View kirby-social-tags-snippet.php
<?php // Open graph ?>
<meta property="og:title" content="TITLE" />
<meta property="og:type" content="ARTICLE OR WEBSITE" />
<meta property="og:url" content="FULL URL" />
<meta property="og:image" content="IMAGE" />
<meta property="og:description" content="DESCRIPTION" />
<meta property="og:site_name" content="SITE NAME" />
<meta property="fb:app_id" content="FB_APP_ID" />
<?php // Twitter cards ?>
<meta name="twitter:card" content="SUMMARY">
View kirby-site-blueprint.yml
<?php if(!defined('KIRBY')) exit ?>
title: Site
pages: true
files: true
fields:
siteinfo:
label: General Settings
type: headline
title:
@juliencharette
juliencharette / gulpfile.js
Created Feb 15, 2016
Basic gulpfile for html5/php development.
View gulpfile.js
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var connect = require('gulp-connect-php');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
var stylish = require('jshint-stylish');
var rimraf = require('rimraf');
@juliencharette
juliencharette / trim.js
Created Dec 8, 2015
JavaScript String Trim
View trim.js
function trimWord(str, count) {
var finalStr = "";
var words = str.split(" ");
if (words.length < count) return str;
for (var i = 0; i < count; i++) {
finalStr += " " + words[i];
if (i == count -1) {
View boilerplate.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Meta -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TITLE</title>
View bash_aliases.sh
alias agi='sudo apt-get install'
alias agr='sudo apt-get remove'
alias agu='sudo apt-get update'
alias documents='cd ~/Documents'
alias downloads='cd ~/Downloads'
alias desktop='cd ~/Desktop'
alias music='cd ~/Music'
alias videos='cd ~/Videos'
You can’t perform that action at this time.