This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<!-- So when i'm in an html document like this and I want to start typing php, I will just type 'php' as bellow --> | |
<!-- The '_' marks where the cursor is when I hit the tab key --> | |
php_ | |
<!-- Then I would want that to expand to the line bellow, placing the cursor in the newly opened php tag --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This function does three things: | |
# 1. Cretes a directory for $sitename | |
# 2. Creates a hosts entry for $sitename | |
# 3. Creates a virtual-hosts entry for $sitename | |
# | |
# Note: Be careful with this function if you aren't comfortable | |
# with editing these system files yourself. If you enter a url you | |
# actiually use, say google.com, then whenever you try to go to | |
# google.com your browser will be pointed to your local google site | |
# at $HOME/Sites/google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; } | |
body { | |
background: #fafafa; | |
font-family: 'Helvetica Neue'; } | |
.wrap { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gulpfile.js | |
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
sass = require('gulp-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
rename = require('gulp-rename'), | |
shell = require('gulp-shell'), | |
livereload = require('gulp-livereload'), | |
lr = require('tiny-lr'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ~/.hydra/init.lua | |
-- This file requires boosh.lua, which can be found in my dotfiles: | |
-- https://github.com/iansinnott/dotfiles/tree/master/dotfiles/hydra | |
require "boosh" | |
-- The 'meta' key for window actions will be cmd+shift. | |
local meta = {"cmd", "shift"} | |
--- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ~/.hydra/boosh.lua | |
ext.grid = {} | |
-- Bits of this file were taken from: | |
-- https://github.com/sdegutis/hydra/wiki/grid.lua | |
local function round(num, idp) | |
local mult = 10^(idp or 0) | |
return math.floor(num * mult + 0.5) / mult | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A wrapper for the docker binary. Checks to make sure the docker host is | |
# set before executing docker commands. | |
docker() { | |
# Start the daemon if it's not running | |
if [ $(boot2docker status) != 'running' ]; then | |
echo 'Starting the Docker daemon.' | |
boot2docker start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Alphabet weight: The index + 1 of each letter in the alphabet. We build this | |
* dictionary to allow speedy lookup of the index of any letter in the alpabet. | |
* We use i + 1 in order to avoid the case where 'a' would have a weight of | |
* zero. | |
*/ | |
var ALPHABET_WEIGHT = {}; | |
[].forEach.call('abcdefghijklmnopqrstuvwxyz', function(letter, i) { | |
ALPHABET_WEIGHT[letter] = i + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" When opening a buffer open to the last line where the cursor was when | |
" exiting. See :help last-position-jump for more. | |
" NOTE: This opens with the cursor in the correct spot, but does not | |
" automcatically open folds. | |
autocmd BufReadPost * | |
\ if line("'\"") > 0 && line("'\"") <= line("$") | | |
\ exe "normal g`\"" | | |
\ endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Asynchronously read a file. This is simply a wrapper around the FileReader | |
* API, which is not great. | |
* @param {File|Blob} file to read | |
* @return {Promise} | |
*/ | |
export const readFile = file => { | |
return new Promise((resolve, reject) => { | |
const reader = new FileReader(); |
OlderNewer