Skip to content

Instantly share code, notes, and snippets.

@benjamin-smith
benjamin-smith / 0_reuse_code.js
Created May 17, 2017 19:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@benjamin-smith
benjamin-smith / elasticsearch-local-development-with-docker-osx.md
Last active October 19, 2021 08:01
Develop locally with Elasticsearch on OSX using Docker

Develop locally with Elasticsearch on OSX using Docker

Docker

Docker does not run natively on OSX, only Linux. Docker Machine was created to add a Linux VM environment to run Docker containers on OSX. Install using Homebrew:

brew install docker
brew install docker-machine
docker-machine create
@benjamin-smith
benjamin-smith / seed-members.md
Last active August 29, 2015 14:08
Seed EE Member Data

Tested with ExpressionEngine 2.9.0

From your project root, update your composer.json file to include the following.

{
    "require": {
        "eecli/bootstrap": "1.3",
        "fzaninotto/faker": "dev-master"
 }
@benjamin-smith
benjamin-smith / PrevNextPage
Last active March 19, 2018 15:59
Custom Pagination in SilverStripe CMS
<?php
class CustomObject extends DataObject {
private static $db = array(
'Sort' => 'Int',
);
private static $default_sort = 'Sort ASC';
var $dateTime = new DateTime();
$dateTime->setTimezone(new DateTimeZone('America/New_York'));
$dateTime->setTimestamp(time());
$isDst = (bool)$dateTime->format('I') ? "y" : "n";
$conf['daylight_savings'] = $isDst;
@benjamin-smith
benjamin-smith / .htaccess
Created March 15, 2013 14:32
#ExpressionEngine .htaccess
RedirectMatch 403 /\.svn.*$
RedirectMatch 403 /\.git.*$
<Files ~ ".htaccess|README|readme.md|\.(sql)|.gitignore|Capfile|Gemfile|Guardfile|Rakefile|config.rb$">
order allow,deny
deny from all
</Files>
Options All -Indexes