Skip to content

Instantly share code, notes, and snippets.

View Phunky's full-sized avatar

Mark Harwood Phunky

View GitHub Profile
@Phunky
Phunky / gist:4658733
Created January 28, 2013 20:31
Exploring ways to handle block component includes in just php (without a template system), not quite sure using the anonymous function is the best approach but removed need to have separate function to end the block although could do this with a class I just didn't like having to instantiate it on each block. Ideas?
<?
$content = 'content before';
function block($tpl){
ob_start();
return function() use ($tpl){
$content = ob_get_clean();
include('templates/' . $tpl . '.php');
@Phunky
Phunky / shame.scss
Created April 22, 2013 09:01
Shame.css mixing
$ashamed: true;
@mixin ashamed {
@if $ashamed == true{
@content;
}
}
body {
background: blue;
@Phunky
Phunky / update-dns.sh
Created September 18, 2013 12:49
Check every hour if external IP has changed and if so update DNS record on linode - simple dynamic dns ;)
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Uses curl to be compatible with machines that don't have wget by default
LINODE_API_KEY=
DOMAIN_ID=
RESOURCE_ID=
WAN_IP=`curl -s http://icanhazip.com/`
if [ -f $HOME/.wan_ip.txt ]; then
@Phunky
Phunky / _base.scss
Created April 9, 2014 09:01
This is an example of how I use SCSS to output separate stylesheets for each breakpoint while only maintaining it in one place, i've also go another version of the mixing which uses the same concept without breakpoints. At some point i'd like to combine these into a single mixin.
@import "breakpoint";
body {
@include breakpoint(large){
background: red;
}
@include breakpoint(normal){
background: green;
m[gt4T667F8M4r4]2/#U8i^%(6^b?(

Keybase proof

I hereby claim:

  • I am phunky on github.
  • I am phunky (https://keybase.io/phunky) on keybase.
  • I have a public key whose fingerprint is DB3E E2DB 3667 03E8 C9DB E771 D5AE A7E0 E779 B561

To claim this, I am signing this object:

@Phunky
Phunky / _colours.fn.scss
Last active August 29, 2015 14:03
Example of my colour map usage
@function colour($name){
@return map-get($colours, $name);
}
@function colour-darken($name, $percentage){
@return darken( map-get($colours, $name), $percentage );
}
@function colour-lighten($name, $percentage){
@return lighten( map-get($colours, $name), $percentage );
@function default-map-value($map, $key, $value){
@if map-has-key($map, $key) {
// Does sass have a falsey lookup? if !map-has-key()?
}
@else {
map-merge($map, ($key, $value));
}
}
@Phunky
Phunky / SassMeister-input-HTML.html
Created July 25, 2014 15:20
Generated by SassMeister.com.
<div class="box___blue">Blue</div>
<div class="box___red">Red</div>
<div class="box___green">Green</div>
<div class="box___indigo">Indigo</div>
<div class="box___teal">Teal</div>
<div class="box___yellow">Yellow</div>
<button class="make-me___green">Call me hulk!</button>
<h1 class="___light-blue">I want to be blue, light blue!</h1>
@Phunky
Phunky / SassMeister-input-HTML.html
Created July 25, 2014 15:36
Generated by SassMeister.com.
<div class="blue">Blue</div>
<div class="red">Red</div>
<div class="green">Green</div>
<div class="indigo">Indigo</div>
<div class="teal">Teal</div>
<div class="yellow">Yellow</div>
<button class="green">Call me hulk!</button>
<h1 class="light-blue">I want to be blue, light blue!</h1>