Skip to content

Instantly share code, notes, and snippets.


Adrian Palmer navitronic

View GitHub Profile

Step 1.

Download and put it somewhere on your computer. eg Desktop.

Step 2.

In terminal, run:

sh folderA folderB
View icons.html
<i class="icon icon--play-1"></i>
<i class="icon icon--repeat-1"></i>
<i class="icon icon--x-1"></i>
<i class="icon icon--up-1"></i>
<i class="icon icon--right-1"></i>
<i class="icon icon--down-1"></i>
<i class="icon icon--left-1"></i>
<i class="icon icon--up-2"></i>
<i class="icon icon--right-2"></i>
<i class="icon icon--down-2"></i>
navitronic / composer.json
Last active Aug 29, 2015
Fresh symfony composer.json
View composer.json
"name": "adrian/installer-test",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-0": {
"": "src/",
"SymfonyStandard": "app/"
View pre-push
CMD="make php-cs"
# Check if we actually have commits to push
commits=`git log @{u}..`
if [ -z "$commits" ]; then
exit 0
navitronic /
Last active Sep 15, 2017
A short bash script that exports all databases into separate gzipped files in a chosen location.
# Example usage
# --
# ./ -u username -p password -t /target/
while getopts u:p:t: option
case "${option}"
navitronic / gist:9679452
Created Mar 21, 2014
Display all hexadecimal colours within a less or css file.
View gist:9679452
$less = file_get_contents(__DIR__ . '/app.less');
preg_match_all('/#([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/', $less, $matches);
$colors = array_values($matches[0]);
$colors = array_map(function($color){ return strtolower($color); }, $colors);
$colors = array_unique($colors);
View gist:6588564
SF.channel_selector = {
init: function($channel_selector) {
var self = this;
if ($channel_selector.length > 0) {
self.channel_selector = $channel_selector.addClass('selector');
self.channel_tabs = self.channel_selector.find('.channel-tabs a');
self.channel_strip = self.channel_selector.find('.channel-strip');
self.channel_strip.css('width', (self.channel_tabs.length * 100) + '%' );

Code Snippets

Show the changed files between two folders

Create a text file showing the differences between two sets of files.

diff -qr foldera folderb | grep -v -e 'DS_Store' -e 'Thumbs' | sort > diffs.txt
View gist:4561344
View css-analysis.php
$css_file = 'foo/bar.css';
$css = file_get_contents($css_file);
preg_match_all('/([a-zA-Z-]+)\:(.+)\;/', $css, $matches);
$totals = array();
foreach ($matches[0] as $match)