Skip to content

Instantly share code, notes, and snippets.

// my-template.jadeextends my-layout  block head  script(src="myfile.js")block content  h1 My page
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"user":{"first_name":"firstname","last_name":"lastname","email":"[email protected]","password":"app123","password_confirmation":"app123"}}' http://localhost:3000/api/1/users
/**
* @param{string} content The contents of a file to download.
* @param{string} fileName The name to save the file as on the user's computer.
*/
function(content, fileName) {
var dataUrl = 'data:text/csv;utf-9,' + encodeURI(content);
var link = document.createElement('a');
angular.element(link)
.attr('href', dataUrl)
.attr('download', fileName) // Pretty much only works in chrome
@DomiR
DomiR / AngularJS.markdown
Last active December 22, 2015 14:48
AngularJS Starter

Introduction


Welcome on this blog/wiki.

Overview

  1. Newbies
  2. Angular
    1. Binding
# Add the remote, call it "upstream":
git remote add upstream git://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
@DomiR
DomiR / TerminalNinja
Created October 18, 2013 18:21
Terminal Tips
# Terminal Ninja
###Processes
```
# Detach
Cmd-z
1) run the "jobs" command to see a list of jobs you've got waiting.
function ff { osascript -e 'tell application "Finder"'\
-e "if (${1-1} <= (count Finder windows)) then"\
-e "get POSIX path of (target of window ${1-1} as alias)"\
-e 'else' -e 'get POSIX path of (desktop as alias)'\
-e 'end if' -e 'end tell'; };\
function cdff { cd "`ff $@`"; };
@DomiR
DomiR / .slate
Created November 27, 2013 16:47 — forked from bsag/.slate
# My slate file
# 10-02-2013
# Basic mappings and bindings for moving screens around
# I have set up my right command key to trigger ctrl+alt+shift+cmd
# see http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#hyper for details
config defaultToCurrentScreen true
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
@DomiR
DomiR / appify
Created December 18, 2013 12:28 — forked from mathiasbynens/appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@DomiR
DomiR / Ubuntu
Last active December 31, 2015 22:39
Fresh ubuntu install
#!/bin/bash
# From
# http://monangik.wordpress.com/2011/04/21/install-zsh-shell-on-ubuntu/
# REPOS
# Sublimetext3
sudo add-apt-repository ppa:webupd8team/sublime-text-3
# Dropbox
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5044912E