Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
// Destroys the localStorage copy of CSS that less.js creates | |
function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/' | |
if (!window.localStorage || !less || less.env !== 'development') { | |
return; | |
} | |
var host = window.location.host; | |
var protocol = window.location.protocol; | |
var keyPrefix = protocol + '//' + host + pathToCss; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/usr/bin/env python | |
# | |
# cocoa_keypress_monitor.py | |
# Copyright © 2016 Bjarte Johansen <[email protected]> | |
# | |
# The MIT License (MIT) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# “Software”), to deal in the Software without restriction, including |
#include <iostream> | |
#include <map> | |
#include <vector> | |
#include <boost/bind.hpp> | |
#include <boost/function.hpp> | |
#include <boost/noncopyable.hpp> | |
#include <boost/scoped_array.hpp> | |
#include <gl/glut.h> | |
#include <gl/SOIL.h> |
<?php | |
if (!function_exists('philsturgeon_said_so')) { | |
function philsturgeon_said_so($what) { | |
return 0 !== preg_match('(FIG|PSR|Pyro|Cider|doing it wrong)i', $what); | |
} | |
} |
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
<?php | |
if(! function_exists('tlog')) { | |
function tlog($logged, $message = '', $user = 'vagrant') | |
{ | |
// Only available in test environments | |
if (app()->environment() === 'production') { | |
return; | |
} |
<?php | |
// Wow this whole thing is horrible | |
class Struct | |
{ | |
public function __construct($properties) | |
{ | |
foreach ($properties as $key => $value) { | |
if (property_exists($this, $key)) { | |
$this->{$key} = $value; |