Skip to content

Instantly share code, notes, and snippets.


Adrian Palmer navitronic

View GitHub Profile
navitronic / gist:9679452
Created March 21, 2014 04:21
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);
navitronic / pre-push
Created April 1, 2015 23:32
pre-push hook
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 / composer.json
Last active August 29, 2015 14:20
Fresh symfony composer.json
View composer.json
"name": "adrian/installer-test",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-0": {
"": "src/",
"SymfonyStandard": "app/"
navitronic / icons.html
Created May 27, 2015 07:23
asimov icons
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 jquery.mNI.js
// Extend jQuery to add a function for implementing "Nice Inputs"
jQuery.fn.makeNiceInput = function(){
// Setup the selected elements as nice inputs.
if(jQuery('label[for='+jQuery(this).attr('id')+']').length > 0){
var MNval = jQuery('label[for='+jQuery(this).attr('id')+']').hide().text();
View localscroll.js
// Local Scroll
function filterPath(string) {
return string.replace(/^\//,'').replace(/(index|default).[a-zA-Z]{3,4}$/,'').replace(/\/$/,'');
$('a[href*=#]').each(function() {
if (
filterPath(location.pathname) == filterPath(this.pathname)
&& location.hostname == this.hostname
&& this.hash.replace(/#/,'')
View gist:794452
/// fun times :D
View gist:1445318
* @Route("/school/search/", name="school_search")
* @Template("FlintSAKGFKitchenGardenProfileBundle:Default:school-search.html.twig")
* @param \Symfony\Component\HttpFoundation\Request $request
* @return array
public function searchAction(Request $request)
navitronic / gist:2364646
Created April 12, 2012 04:42
f*ck trying to make a responsive grid
View gist:2364646
<div class="something">
<div class="third">first child, no left padding.</div>
<div class="third">left padding</div>
<div class="third something">
left padding
<div class="half">first child, no left padding</div>
<div class="half">left padding.</div>
navitronic / r-boilerplate.css
Created April 12, 2012 05:36
Responsive CSS boilerplate
View r-boilerplate.css
/* Mobile / General Styles
Code up general styles and mobile styles, use media queries to adapt to larger displays.
Things for this section: Reset, Typography, Baseline grid, etc. Convenience methods for image-replacement, hiding, clearing etc.
/* Desktop and iPad/Tablet specific styles. */