Skip to content

Instantly share code, notes, and snippets.

Avatar

Anselm Christophersen anselmdk

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

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

View EmptyCacheTask.php
<?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 Jan 30, 2016
Convert file from lation1 to utf-8
View gist:ccdb0a91913f2f474578
iconv --from-code=ISO-8859-1 --to-code=UTF-8 old.txt > new.txt
@anselmdk
anselmdk / misc.md
Created Feb 23, 2016
PHP Cheat Sheet
View misc.md

PHP Cheat Sheet

Save to file

file_put_contents('myfile','content');
@anselmdk
anselmdk / fields.md
Last active Mar 3, 2016
SilverStripe Topics
View fields.md
@anselmdk
anselmdk / README.md
Last active Mar 29, 2016
React Cheat Sheet
View README.md

React Cheat Sheet

@anselmdk
anselmdk / FeatureContext.php
Last active May 24, 2016
Behat tests for SilverStripe modules
View FeatureContext.php
<?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 Oct 5, 2016
NPM Cheat Sheet
View npm.md

NPM Cheat Sheet

install

npm install --save PACKAGE
npm install --save-dev PACKAGE
You can’t perform that action at this time.