Skip to content

Instantly share code, notes, and snippets.

View kreas's full-sized avatar
:shipit:
Heathen

Tim Warren kreas

:shipit:
Heathen
View GitHub Profile

markdown reference

footnotes:

works in tumblr with markdown editor enabled
requires multimarkdown

input:
sentence with footnote[^1].

Header 1
h2. Header 2
h3. Header 3
h4. Header 4
h5. Header 5

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
line (or many), and can drone on for hours. “Quotes” and ‘quotes’ are handled
nicely—as are dashes and such.

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@kreas
kreas / gist:5529020
Last active December 17, 2015 01:29
Super simple form validation. **Requires jQuery and Underscore**
required_fields = $('[required="required"], .required')
$('.validate').click () ->
validate_form()
if $('.input-error').length == 0
$('form').submit()
false
required_fields.blur () ->
validate_input(@)
@kreas
kreas / gist:6455780
Created September 5, 2013 20:34 — forked from afeld/gist:5704079

This was tested using Ruby 2.0.0 and Rails 4.0.0.rc1.

Bower

  1. Set the install directory for Bower components:

    // .bowerrc
    {

"directory": "app/assets/components"

library form;
import 'dart:html';
class Form {
static String formType = window.location.hash.replaceFirst('#', '');
Form(){
importForm(formType);
}
package com.company;
import java.util.Arrays;
public class Main extends TestCase {
static public void main(String[] args) {
// Assessment 0: Multiples of 3 and 5 in n
assertEqual(multiplesOf3And5(1000), 233168);
assertEqual(multiplesOf3And5(500), 0);
(function(){
function multiply_by_two(num){
if (typeof num === 'number'){
return num * 2;
} else {
return num + ' is not a valid number';
}
}
// If the value is equal write '.' to the page if not write 'F'
@kreas
kreas / rails.sh
Last active August 29, 2015 14:16
#!/bin/bash
echo Provisioning Evergreen...
echo - Installing dependencies
sudo apt-get update -y -qq > /dev/null
sudo apt-get install curl -y -qq > /dev/null
echo - Installing other software
sudo apt-get -y install libxslt-dev libxml2-dev
sudo apt-get -y install nodejs
#!/bin/bash
echo Provisioning Evergreen...
echo - Installing dependencies
sudo apt-get update -y -qq > /dev/null
sudo apt-get install curl -y -qq > /dev/null
echo - Installing other software
sudo apt-get -y install libxslt-dev libxml2-dev
sudo apt-get -y install nodejs