Skip to content

Instantly share code, notes, and snippets.

View timboslice69's full-sized avatar

Timbo Slice timboslice69

View GitHub Profile
@timboslice69
timboslice69 / keystonejs-quicksetup.sh
Last active July 29, 2016 08:27
A shell script to create a basic KeystoneJS installation
#!/usr/bin/env bash
echo "******************************"
echo "Setting up Keystone"
echo "******************************"
echo "*** Define Project"
read -p "Name your project (lowercase, default is 'keystone_cms'): " projectName
projectName=${projectName:-"keystone_cms"}
@timboslice69
timboslice69 / models-Page.js
Created April 27, 2015 13:39
Role based security in KeystoneJS
var keystone = require('keystone'),
// pull in the schemaPermissions lib
// rootRequire is a custom function that fixes the path to always be from the root of the application
schemaPermissions = rootRequire('lib/schemaPermissions'),
Types = keystone.Field.Types;
/**
* Page Model
* ==========
*/
@timboslice69
timboslice69 / eggsDeveloper.js
Created August 29, 2014 14:03
The life of an Eggs Developer
/**
* Become an eggs developer, look at cats, work on great projects, increase enjoyment!
* @returns {EggsDeveloper}
* @constructor
*/
var EggsDeveloper = function(){ return this; };
EggsDeveloper.prototype = {
startDay: function(){
@timboslice69
timboslice69 / svg.html
Last active August 29, 2015 14:05
Replacing xlink svgs with symbol contents on load
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script>
window.onload = function(){
var symbol, parent, elements = document.getElementsByTagName("use");
while (elements.length > 0){