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>
View composer.json
{
"name": "adrian/installer-test",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-0": {
"": "src/",
"SymfonyStandard": "app/"
}
},
View pre-push
#!/bin/sh
CMD="make php-cs"
# Check if we actually have commits to push
commits=`git log @{u}..`
if [ -z "$commits" ]; then
exit 0
fi
View db-backup.sh
#!/bin/bash
# Example usage
# --
#
# ./db-backup.sh -u username -p password -t /target/
while getopts u:p:t: option
do
case "${option}"
View gist:9679452
<?php
$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);
sort($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) + '%' );
View code-snippets.md

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
/\[accordion\]([^\[]+)\[\/accordion\]/
View css-analysis.php
<table><?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)
{
View wp_posts-snippet.sql
SELECT post_type, COUNT(*) AS total
FROM wp_posts GROUP BY post_type;