Skip to content

Instantly share code, notes, and snippets.

@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
@hileon
hileon / gist:1311735
Created October 25, 2011 07:39 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@keithics
keithics / gist:6190293
Created August 9, 2013 00:52
Get column names in Laravel 4
<?php
class BaseModel extends Eloquent {
public function columns(){
$table = $this->getTable();
return DB::select(" SHOW COLUMNS FROM ".$table);
}
@captbaritone
captbaritone / mail.php
Last active February 22, 2018 23:08
This is the mail configuration I use on Laravel to get it to send email to [MailCatcher](http://mailcatcher.me/)
<?php
return array(
// Send it mail via SMTP
'driver' => 'smtp',
// Whatever port you have MailCatcher's SMTP server running on (they suggest 1025)
'port' => 1025,
@asimpson
asimpson / bucket-policy.json
Last active January 3, 2016 03:19
A policy template to restrict a user's access to a single bucket.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": ["s3:GetBucketLocation", "s3:ListAllMyBuckets"],
"Effect": "Allow",
"Resource": ["arn:aws:s3:::*"]
},
{
"Action": ["s3:ListBucket"],
@andrewdelprete
andrewdelprete / laracon-2014-notes.md
Last active November 19, 2018 17:19
My notes from Laracon 2014

###Jeffrey Way (1) - Bootcamp

Jeffrey went through about 12 subjects one right after the other and gave tips along the way.

  1. Mail Drivers for mail notifications.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
  1. File Generators for generating schema migrations.
@adamwathan
adamwathan / v-cloak.md
Last active November 6, 2024 14:28
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@fideloper
fideloper / nginx.conf
Last active February 15, 2017 22:09
Nginx redirects
server {
# ...
# Redirect /book and any sub-uris
# e.g. /book/anything
# e.v. /book/whatever?maybe=a_query_too
location /book {
return 301 http://book.serversforhackers.com;
}