Skip to content

Instantly share code, notes, and snippets.

View anselmdk's full-sized avatar

Anselm Christophersen anselmdk

View GitHub Profile
@anselmdk
anselmdk / gist:f4d3b708a46b32ce1afb
Created January 12, 2015 15:09
remove html body to see a formatted `var_dump` from php
var pre = $('pre');
$('body').remove();
$('html').append(pre);
@anselmdk
anselmdk / bash
Created November 18, 2015 12:57
Check PHP server time through command line
php -r "echo date('Y-m-d h:i:s a', time());"
@anselmdk
anselmdk / README.md
Last active November 24, 2015 09:26
Understanding React w. Redux(WORK IN PROGRESS)

Want to build a website using React and Redux? Here's a few concepts you'll need to grasp

  • Browserify makes it possible to write node syntax in javascript files
  • Watchify is the watch mode for Browswerify
  • Webpack is a module bundler that is almost exclusively used with Redux projects

Resources

<?php
/**
* EmptyCacheTask
* See also https://github.com/markguinn/sstools/blob/master/code/SSTasks.php for more like this
*
*
* @author Anselm Christophersen <ac@title.dk>
* @package titlelibs
* @subpackage tasks
*/
@anselmdk
anselmdk / gist:ccdb0a91913f2f474578
Last active January 30, 2016 10:50
Convert file from lation1 to utf-8
iconv --from-code=ISO-8859-1 --to-code=UTF-8 old.txt > new.txt
@anselmdk
anselmdk / misc.md
Created February 23, 2016 16:40
PHP Cheat Sheet

PHP Cheat Sheet

Save to file

file_put_contents('myfile','content');
@anselmdk
anselmdk / fields.md
Last active March 3, 2016 09:39
SilverStripe Topics
@anselmdk
anselmdk / README.md
Last active March 29, 2016 10:51
React Cheat Sheet

React Cheat Sheet

@anselmdk
anselmdk / FeatureContext.php
Last active May 24, 2016 04:08
Behat tests for SilverStripe modules
<?php
namespace SilverStripe\Mysite\Test\Behaviour;
use SilverStripe\Cms\Test\Behaviour;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
/**
* Features context
@anselmdk
anselmdk / npm.md
Last active October 5, 2016 09:39
NPM Cheat Sheet

NPM Cheat Sheet

install

npm install --save PACKAGE
npm install --save-dev PACKAGE