Skip to content

Instantly share code, notes, and snippets.

View christianhanvey's full-sized avatar

Christian Hanvey christianhanvey

View GitHub Profile
@bpainter
bpainter / arrows.scss
Created July 15, 2011 19:08
Sass mixin for arrows based on The Shapes of CSS from Chris Coyier http://css-tricks.com/examples/ShapesOfCSS/
// --------------------------------------------------------
// arrows
// --------------------------------------------------------
// $direction: top, left, right, bottom, top-left, top-right, bottom-left, bottom-right
// $color: hex, rgb or rbga
// $size: px or em
// @example
// .element{
// @include arrow(top, #000, 50px);
// }
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@artero
artero / launch_sublime_from_terminal.markdown
Last active May 15, 2024 03:38 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@oksushi
oksushi / migx_modx-2.2.diff
Created October 6, 2011 04:43 — forked from netProphET/migx_modx-2.2.diff
MIGX diff for MODX2.2
--------------- core/components/migx/elements/tv/input/migx.php ---------------
index 11a9c2d..53370a5 100644
@@ -133,6 +133,7 @@ $lang = $this->xpdo->lexicon->fetch();
$lang['mig_add'] = !empty($properties['btntext'])?$properties['btntext']:$lang['mig_add'];
$modx->smarty->assign('i18n', $lang);
$this->xpdo->smarty->assign('properties', $properties);
+$this->xpdo->smarty->assign('resource', is_object($this->xpdo->resource) ? $this->xpdo->resource->toArray() : array());
$this->xpdo->smarty->assign('pathconfigs', $this->xpdo->toJSON($pathconfigs));
$this->xpdo->smarty->assign('columns', $this->xpdo->toJSON($cols));
$this->xpdo->smarty->assign('fields', $this->xpdo->toJSON($fields));
@oksushi
oksushi / MODCreateSubdocs
Created October 14, 2011 02:40
MODX: Plugin to create sub document on save - apply OnDocFormSave
<?php
if ($mode == 'new') {
$new = $modx->newObject('modDocument');
$new->set('parent',$id);
$new->set('pagetitle','My New Pagetitle');
$new->save();
}
@bfncs
bfncs / defaultTemplateByParentTv.plugin.php
Created December 13, 2011 23:55
Default Children Template by Parent TV - modX Revolution Plugin
<?php
/**
* =========================
* defaultTemplateByParentTv
* =========================
*
* Plugin for modX Revolution
* Set default template for children of a ressource
*
* Author:
@rosstimson
rosstimson / modx-git-bootstrap.sh
Created December 20, 2011 18:01
Quickly Bootstrap MODX (Revo) from Git Repo
#!/bin/sh
# Request and read in db details from user
echo "Please enter your database hostname
(e.g. localhost) and press [ENTER]:"
read db_host
echo "Please enter your MODX database name and press [ENTER]:"
read db_name
echo "Please enter your MODX database user and press [ENTER]:"
read db_user
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@vasilisvg
vasilisvg / more.md
Last active December 4, 2020 04:48
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.

You should have a similar script.