Skip to content

Instantly share code, notes, and snippets.

View Johnathan's full-sized avatar

Johnathan Barrett Johnathan

View GitHub Profile
// ==UserScript==
// @name fuck rats
// @namespace fuck rats
// @version 0.1
// @description fuck rats
// @author fuck rats
// @match *://*/*
// @grant none
// ==/UserScript==
<template>
<div>
<a href="#" v-bind:class="buttonClass" @click.prevent="submitForm"><slot></slot></a>
<form :action="href" method="POST" ref="form" style="display:none;">
<input type="hidden" name="_method" value="DELETE" />
<input type="hidden" name="_token" :value="csrfToken" />
</form>
</div>
</template>
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
if ( $validation->passes() )
{
$user = new User;
$user->first_name = $user_data['first_name'];
$user->surname= $user_data['surname'];
$user->email = $user_data['email'];
$user->password = Hash::make( $user_data['password'] );
$user->active = 1;
$user->save();
define [ "jquery", "underscore", "backbone", "vm", "text!templates/plan/sidebar.html", "handlebars", "views/plan/plan", "views/plan/tasks" ], ($, _, Backbone, Vm, sidebarTemplate, Handlebars, planView, taskView) ->
class SidebarView extends Backbone.View
initialize: (options) =>
@options = options
@plan_model = options.plan_model
@planView = new planView( options )
$( '#signup' ).live( 'click', function( e ){
e.preventDefault();
planzai.showLoadingSign();
var form = $( 'form' );
$.post( form.attr( 'action' ), form.serialize(), function( data ){
if( typeof data == 'object' )
{
window.location = data.redirect;
}
else
PROMPT='
%{$fg_bold[red]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)$(git_prompt_status)
$(virtualenv_info)-> '
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[green]%}+$fg[red]%}-$reset_color%}$fg[white]"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}•%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔%{$reset_color%}"
$.each( weeks, ( i, week ) =>
console.log i
for_week = 'w/c ' + new Date.parse( i ).toString( 'dddd d MMMM' )
@$el.prepend @template {for: i, for_tidy: for_week, tasks_due: week.length}
)
$.each( weeks, ( i, week ) =>
for_week = 'w/c ' + new Date.parse( i ).toString( 'dddd d MMMM' )
@$el.prepend @template {for: i, for_tidy: for_week, tasks_due: week.length}
$.each( week, ( index, task ) =>
task_data = task
task_data.assignment_count = task.assignments.length
$( '#for_' + i ).append @task_template task_data
)
)
$.each( weeks, ( i, week ) =>
for_week = 'w/c ' + new Date.parse( i ).toString( 'dddd d MMMM' )
@$el.prepend @template {for: i, for_tidy: for_week, tasks_due: week.length}
$.each( week, ( index, task ) =>
task_data = task
task_data.assignment_count = task.assignments.length
$( '#for_' + i ).append @task_template task_data
)
)