Skip to content

Instantly share code, notes, and snippets.

View jeroendesloovere's full-sized avatar

Jeroen Desloovere jeroendesloovere

View GitHub Profile
@Thijzer
Thijzer / fork-converter.php
Last active August 29, 2015 13:56
Fork: spoon 2 twig converter
#!/usr/bin/php -q
<?php
// declaring some vars
(!empty($argv[1])) ? $inputFile = $argv[1] : exit('no input file given as parameter' . PHP_EOL);
date_default_timezone_set("Europe/Brussels");
$selection = false;
$method = false;
$fh = fopen('php://stdin', 'r');
@alexdunae
alexdunae / smushit.sh
Created October 15, 2009 16:45
Image optimization with a home-rolled Smush.it
#!/bin/bash
#
# Home-rolled Smush.it, by Alex Dunae (http://dialect.ca).
#
# N.B. This script works for me; it may not work for you.
# Since it overwrites your images with the optimized version, you should
# backup your files before running this script and do a trial run before
# getting too excited. This is your disclaimer.
#
# Uses jpegtran (http://jpegclub.org/jpegtran/), part of libjpeg,
FROM php:7.1-apache
MAINTAINER Tijs Verkoyen <tijs@sumocoders.be>
# Install unzip
RUN apt-get update && apt-get install -y \
unzip
# Install git
RUN apt-get update && apt-get install -y \
@Thijzer
Thijzer / clean_install_fork
Last active June 22, 2018 11:05
a simple script for fork CMS clean installing & testing
#!/bin/bash
#
# This script will remove everything and pull in the new version
#
# @version 1.0.0
# @author <thijs@wijs.be>
# mySQL settings
user=$1
password=$2
@scottjehl
scottjehl / anchorinclude.js
Created May 20, 2011 17:04
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>
@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"