This file contains hidden or 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
| $("button").click(function() { | |
| $.ajax({ | |
| type: "POST", | |
| url: "/products", | |
| data: { product: { name: "Filip", description: "whatever" } }, | |
| success: function (data) { | |
| alert(data.id); | |
| return false; | |
| }, | |
| error: function(data) { |
This file contains hidden or 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
| <?php | |
| use Illuminate\Support\Facades\Log; | |
| /** | |
| * Debug request information. | |
| */ | |
| Route::filter('debug_info', function( $route, $request ) { | |
| Log::debug("REQUEST", array( |
This file contains hidden or 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 | |
| # modified by http://github.com/zeroeth for color/alignment | |
| # modified by http://github.com/kortina | |
| # original from http://github.com/jehiah | |
| # this prints out branch ahead/behind status vs origin/master for all branches | |
| # example: | |
| # $ git-branch-status | |
| # dns_check (ahead 1) | (behind 112) origin/master | |
| # master (ahead 2) | (behind 0) origin/master |
This file contains hidden or 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
| # Only needed once, rather slow. checkout the project url without /trunk on the end. | |
| # -b needs test/branches because a non-standard layout in the repo I'm working with. | |
| # | |
| git svn clone https://<repo url> -T trunk -b test/branches -t tags <local folder name> | |
| # Mirror the svn ignore into your local git (Does not require checking in any git related files) | |
| # can take a few minutes, make sure you are in the project folder first. | |
| # | |
| git svn show-ignore >> .git/info/exclude |
This file contains hidden or 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
| # LOCAL GIT REPO COMMANDS | |
| # | |
| # in project folder | |
| git init . | |
| # (rinse repeat this pattern) | |
| # CODECODECODE |
This file contains hidden or 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
| # create remote branch | |
| git svn branch new_feature | |
| # check out new local branch | |
| git checkout -b new_feature | |
| # the magic command to setup the svn remote properly | |
| git rebase remotes/new_feature | |
| # (your git commits here) |
This file contains hidden or 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
| Backbone.Router.extend({ | |
| routes: { | |
| "": "showWelcome", | |
| "other": "showOther", | |
| "*nomatch": "notFound", | |
| }, | |
| notFound: function() { | |
| console.info("Route not found:", arguments); | |
| }, |
This file contains hidden or 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
| " Indentation Settings | |
| " | |
| " Soft 2 space | |
| " set tabstop=2 | |
| " set shiftwidth=2 | |
| " set expandtab | |
| " Hard tab | |
| set noexpandtab | |
| set tabstop=4 | |
| set shiftwidth=4 |
This file contains hidden or 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
| class Awesome | |
| attr_accessor :first_var | |
| def second_var= value | |
| @second_var = value; | |
| end | |
| def second_var | |
| @second_var | |
| end |
This file contains hidden or 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
| # from bendyworks | |
| function parse_git_branch { | |
| \git rev-parse --git-dir &> /dev/null | |
| git_status="$(git status 2> /dev/null)" | |
| branch_pattern="^# On branch ([^${IFS}]*)" | |
| remote_pattern="# Your branch is (.*) of" | |
| diverge_pattern="# Your branch and (.*) have diverged" | |
| if [[ ! ${git_status}} =~ "working directory clean" ]]; then | |
| state="${RED}⚡" | |
| fi |