Skip to content

Instantly share code, notes, and snippets.

View peschee's full-sized avatar
Grabbing another coffee…

Peter Siska peschee

Grabbing another coffee…
View GitHub Profile
git init
git submodule add git://github.com/kohana/core.git system
git submodule add git://github.com/kohana/database.git modules/database
git submodule add http://github.com/kohana/userguide.git modules/userguide
git submodule add http://github.com/kohana/image.git modules/image
git submodule add http://github.com/kohana/codebench.git modules/codebench
git submodule add http://github.com/kohana/auth.git modules/auth
git submodule add http://github.com/kohana/pagination.git modules/pagination
git submodule add http://github.com/kohana/orm.git modules/orm
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Multiple if statements, or a switch statement,
// can handle as many environments as you need
if ($_SERVER['HTTP_HOST'] == "local-site.dev") {
$active_group = 'expressionengine';
} else {
$active_group = 'enginehosting';
}

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
  1. ssh in to your Synology
  2. $ vi /root/.profile
  3. prepend /opt/bin:/opt/sbin: to PATH so it looks like PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
    replace the standard rdiff packages with symlinks:
  4. $ ln -s /opt/bin/rdiff-backup-2.6 /usr/bin/rdiff-backup
  5. $ ln -s /opt/bin/rdiff-backup-statistics-2.6 /usr/bin/rdiff-backup-statistics
@peschee
peschee / Default (OSX).sublime-keymap -- User
Created February 3, 2016 13:24 — forked from coldnebo/Default (OSX).sublime-keymap -- User
Sublime Text 2 fix for OSX home/end keys
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }
@peschee
peschee / setup-es6-linting.md
Created February 4, 2016 08:50
Linting ES6+Babel+JSX in Atom

Setup ES6+Babel+JSX Linting with Atom

This sets up Atom to properly lint ES6+Babel+JSX using Airbnb's .eslintrc as a starting point.

Steps

  1. Download Atom and get these two packages: Linter and [Linter-ESLint)(https://atom.io/packages/linter-eslint)
  2. Run npm install --save-dev eslint-config-airbnb babel-eslint eslint-plugin-react from your project root.
  3. Add "extends": "eslint-config-airbnb" to your .eslintrc
@peschee
peschee / readme.md
Created March 1, 2016 13:24 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
#
# gem install cloudapp_api
# ruby cloudapp-export.rb adam@atechmedia.com mypassword
#