Skip to content

Instantly share code, notes, and snippets.

View denisinla's full-sized avatar
👋

denisinla

👋
View GitHub Profile
@denisinla
denisinla / trajan.zsh-theme
Created August 29, 2014 06:07
theme for ohmyzsh
PROMPT='%{$fg_bold[yellow]%} λ %c: %{$reset_color%}'
RPROMPT='$(git_prompt_info) $(git_prompt_short_sha) %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}Branch%{$reset_color%}%{$fg[grey]%} / %{$reset_color%}%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[green]%}"
#ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%} %{$fg[yellow]%}| SHA:%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%} / %{$reset_color%}%{$fg[red]%}SHA:%{$reset_color%}%{$fg[green]%}"
@denisinla
denisinla / web.js
Created August 26, 2014 01:55
Express mod for pushstate.
var express = require('express');
var app = express();
app.set('port', (process.env.PORT || 80));
app.use(express.static(__dirname + '/../app'));
app.use(function(req, res) {
var newUrl = req.protocol + '://' + req.get('Host') + '/#' + req.url;
return res.redirect(newUrl);
});
# if the resource is not found then forward to backbone's router
app.use (req, res) ->
newUrl = req.protocol + '://' + req.get('Host') + '/#' + req.url
res.redirect newUrl
// Use absolute URLs to navigate to anything not in your Router.
var openLinkInTab = false;
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
$(document).keydown(function(event) {
if (event.ctrlKey || event.keyCode === 91) {
openLinkInTab = true;
@denisinla
denisinla / web.js
Created August 20, 2014 03:41
Express server config for backbone SPAs with pushState set to true. (http://stackoverflow.com/a/18553854/1172652)
var http = require('http');
var fs = require('fs');
var express = require('express');
var app = express();
// Read all static files from directory
app.use(express.static(__dirname + '/../app/'));
// Default HTML file for any requests
app.use(function(req,res){
@denisinla
denisinla / install-pathogen.md
Created August 19, 2014 04:45
Install Pathogen

Backup VIM

mv ~/.vimrc ~/.vimrc.bak
mv ~/.vim/ ~/.vimbak/

Create new VIM directory

@denisinla
denisinla / index.html
Created August 17, 2014 06:22
Decoupling jquery custom events. // source http://jsbin.com/wacut/5
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>Decoupling jquery custom events.</title>
<style id="jsbin-css">
body{
font: 13px "Helvetica",Arial,sans-serif;
color: #333
@denisinla
denisinla / mapbox-require.js
Created August 17, 2014 00:52
Mapbox + RequireJS
require.config({
paths: {
"jquery": "//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min",
"fitText": "/js/vendor/jquery.fittext",
"fitVids": "/js/vendor/jquery.fitvids",
"mapbox": "//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox"
}
});
require(['mapbox'], function() {
@denisinla
denisinla / Preferences.sublime-settings
Last active August 29, 2015 14:05
February2015 Preferences for ST3
{
"theme": "Glacier.sublime-theme",
"color_scheme": "Packages/Theme - Glacier/glacier.tmTheme",
"color_inactive_tabs": true,
"detect_indentation": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",