Skip to content

Instantly share code, notes, and snippets.

View johan--'s full-sized avatar

johan pretorius johan--

View GitHub Profile
@johan--
johan-- / ngAdmin Login
Last active August 27, 2015 08:37 — forked from leonardorame/ngAdmin Login
ng-admin login
/*
Small ng-admin config showing how to inject a Login controller when
a 401 error is returned by the server.
*/
(function () {
"use strict";
var app = angular.module('myApp', [
@johan--
johan-- / index.md
Created April 23, 2014 12:42 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

TodoMVC.module 'TodoApp', (App, TodoMVC, Backbone, Marionette, $, _) ->
log arguments
class App.TodoForm extends Marionette.ItemView
events:
'keypress #new-todo' : 'createOnEnter'
'click .mark-all-done' : 'toggleAllClicked'
triggers:
'click .todo-clear a' : 'clear:completed'
# This is a simple script to convert an XML file exported
# from Evernote into a bookmarks file that can be imported
# into Pinboard. In my case, all I cared about were notes
# that had a source-url, and all I'm retaining is the title
# and URL. I'm adding a fixed "evernote" tag for all notes.
require 'nokogiri'
def note_attributes(note)
{
#!/usr/bin/env ruby
require 'appscript'
require 'nokogiri'
require 'open-uri'
require 'clipboard'
url = ARGV.length >= 1 ? ARGV[0] : Clipboard.paste
def zhihu(doc)
<!-- http://twitter.github.io/typeahead.js/data/repos.json -->
<input type="text" autocomplete="off" class="form-control"
id="client-search"
data-typeahead-url="./repos.json"
data-typeahead-target="client-id">
<input type="hidden" id="client-id" name="client-id">
<!-- http://twitter.github.io/typeahead.js/data/repos.json -->
<input type="text" autocomplete="off" class="form-control"
id="client-search"
data-typeahead-url="./repos.json"
data-typeahead-target="client-id">
<input type="hidden" id="client-id" name="client-id">

This is my recommended path for learning Haskell.

Something to keep in mind: don't sweat the stuff you don't understand immediately. Just keep moving.

Primary course

Installing Haskell

Ubuntu PPA

  1. Check if a page variable has been defined
    1. Set variables in a page (page.html.haml) at the very biginning of the file:

      ---
      variable: value
      variable2: value 2
      ---