Skip to content

Instantly share code, notes, and snippets.

View eduardomart's full-sized avatar

Eduardo Martinez eduardomart

View GitHub Profile
@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
@saetia
saetia / gist:1623487
Last active March 19, 2024 15:21
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@g3d
g3d / gist:2709563
Last active February 7, 2024 15:21 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@LeVM
LeVM / Default (OSX).sublime-keymap
Created September 27, 2012 18:58
Sublime Text 2 - View in multiple broswers
{ "keys": ["alt+1"], "command": "open_browser", "args": {"keyPressed": "1"} },
{ "keys": ["alt+2"], "command": "open_browser", "args": {"keyPressed": "2"} },
{ "keys": ["alt+3"], "command": "open_browser", "args": {"keyPressed": "3"} },
{ "keys": ["alt+4"], "command": "open_browser", "args": {"keyPressed": "4"} }
@lavoiesl
lavoiesl / .htaccess
Created November 21, 2012 19:37
Automatically compile LESS files
# LESS compiler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} ^(.*)\.css
RewriteCond %1.less -f
RewriteRule ^(.*)\.css lessphp/less.php?f=$1.less
@erikflowers
erikflowers / fixed-screen-layered-background.less
Last active January 31, 2019 10:48
A Less mixin for layering 2 images in a background, and using "background-cover" so the bottom layer is always full size. Good for scrolling fixed backgrounds where you want a screen or other element on top. Here's a 2x2 pixel grid to get you started: http://www.helloerik.com/downloads/grid.png.zip See an example here:
.background-layers(@top, @bottom) {
background: url(@top), url(@bottom);
background-position: top center, top center;
background-attachment: fixed, fixed;
background-repeat: repeat, repeat;
-webkit-background-size: auto, cover;
-moz-background-size: auto, cover;
-o-background-size: auto, cover;
background-size: auto, cover;
}
@rossriley
rossriley / gist:bb16ea1b7933292a12a4
Created April 9, 2015 12:07
How to adjust upload size by contenttype
$app->initialize();
$app['upload'] = $app->extend('upload', function ($handler, $app) {
if ($app['request']->get('contenttype') == 'pages') {
$handler->addRule('size', ['size' => '100K'], '{label} uploads are limited to {size}', 'Page Image');
}
return $handler;
});
$app->run();
var CKEDITORPluginExtras = false;
if (typeof(CKEDITOR) != 'undefined' ) {
CKEDITOR.on('instanceReady',function(event, instance){
if (CKEDITORPluginExtras) {
return;
}
var config = event.editor.config;
CKEDITOR.instances.body.destroy();
$app['upload'] = $app->share(
$app->extend(
'upload',
function ($upload, $app) {
$upload->setSanitizerCallback(
function ($filename) use () {
// do custom sanitising here...
}
);
<?php
// This line needs to be called after initialize but before run
$app['upload'] = $app->extend(
'upload',
function ($handler, $app) {
if ($app['request']->get('contenttypeslug') && $app['request']->get('id')) {
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".$app['request']->get('id'));
}