Skip to content

Instantly share code, notes, and snippets.

View mikestreety's full-sized avatar

Mike Street mikestreety

View GitHub Profile
@mikestreety
mikestreety / SassMeister-input-HTML.html
Created February 18, 2014 16:26
Generated by SassMeister.com.
<div class="list">HELLO</div>
<div class="sidebar">
<div class="list">HELLO</div>
</div>
@mikestreety
mikestreety / SassMeister-input.scss
Created February 6, 2014 10:29
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@mixin background-opacity($theme) {
background-color: nth($theme, 1); //fallback
background-color: nth($theme, 2);
@mikestreety
mikestreety / SassMeister-input.scss
Created January 22, 2014 09:24
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@mixin base($class) {
[class*="#{$class}"] {
@content;
}
}
@mikestreety
mikestreety / SassMeister-input.scss
Created January 8, 2014 10:13
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$basefont: 'Arimo',Arial,sans-serif;
$basefontsize: 12px;
$basegutter: 15px;
$min-width: 1100px;
@mikestreety
mikestreety / SassMeister-input.scss
Created January 7, 2014 17:33
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
.box {
background: red;
.heading {
font-size: 20px;
}
@mikestreety
mikestreety / input.scss
Last active January 2, 2016 09:09
An unnecessarily complex font face dec
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@mixin font-face($font-name, $file, $svg-font-name: false, $weight: 100, $style: normal) {
@font-face {
$font-src: false;
$font-list: (
'eot?#iefix' 'embedded-opentype',
@mikestreety
mikestreety / SassMeister-input.scss
Created January 6, 2014 10:09
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@mixin font-face($font-name, $file, $svg-font-name: false, $weight: 100, $style: normal) {
@font-face {
$fonts: url('#{$file}.eot?#iefix') format('embedded-opentype'), url('#{$file}.woff') format('woff'), url('#{$file}.ttf') format('truetype');
@if($svg-font-name) {
@mikestreety
mikestreety / gist:8025134
Created December 18, 2013 16:20
List all the items in a dir
<?php
$dir = dirname(__FILE__); // Sets the dir you want to show images for
foreach(scandir($dir) as $item) : // for every item in the folder
if($item == '.') continue; // If it equals to any of these, don't show them
if($item == '..') continue;
if($item == 'index.php') continue; ?>
<?=$item?> <!-- echo the path -->
<?php endforeach; ?>
@mikestreety
mikestreety / watch.sh
Created December 6, 2013 18:53
Using inotify to detect changes in a file. This case is used for less files to compile them
if which inotifywait >/dev/null; then # Checks to see if inotify tools exists
folder=`pwd`; # This is where it searches - pwd will run that command and run the rest based on your current folder
while true;
do
N=`find $folder -name "*.less"`; # Currently searches for all .less files in the folder above using a standard find command
if [[ -z $N ]]; then # If there is nothing found then it exits
echo There are no LESS files to be found - maybe cd to where there is some.
exit;
else
fileout=`inotifywait -qe modify $N`; # Gets the name of the file that was modified
@mikestreety
mikestreety / gist:6053898
Created July 22, 2013 13:42
Adds an extra key/value pair to a json file
<?php
// This takes a get of location and postcode to put into a json file for use with https://github.com/MrQwest/activity
/* Example use:
$.ajax({
url: 'file.php',
type: 'GET',
data: {
location: [LOCATION - VARIABLE OR STRING],