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
| {-| | |
| - Example of using free constructions to build a flexible little compiler. | |
| - | |
| - The goal here is not necessarily efficiency but readability and flexibility. | |
| - | |
| - The language grammar is represented by an ADT; however, instead of | |
| - recursively referring to itself it instead references a type variable. | |
| - | |
| - We derive instances of 'Functor' and 'Traversable' for this type. | |
| - |
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
| Moved to a proprer repositoy, TSWS is a real boy now! | |
| https://github.com/dfletcher/tsws | |
| PRs welcomed. |
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
| /* | |
| A pure ES6-style composable React component that handles clicks outside of a HTML node. | |
| This is for those who prefers composibility over mixins. | |
| Simply drop-in the event listener component into your React component. | |
| Adapted from: https://github.com/Pomax/react-onclickoutside | |
| */ | |
| var React = require('react'); |
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
| {-# LANGUAGE RecordWildCards #-} | |
| module Grid where | |
| import Data.Maybe | |
| newtype Grid a = Grid { unGrid :: [[a]] } | |
| type ListZipper a = ([a], a, [a]) |
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
| #login | |
| curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"user":{"email":"<email>","password":"<passwd>"}}' http://localhost:3000/api/v1/sign_in.json | |
| #logout | |
| curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:3000/api/v1/sign_out.json?auth_token=<token> |
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
| task PrepareClickOnce { | |
| write-host 'Add mage to our path' | |
| $env:path += ";C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools" | |
| write-host "Preparing install directory" | |
| $installersRoot = '..\installers\app' | |
| if (test-path $installersRoot) { | |
| Write-Host "Cleaning installers root" | |
| rm -r -force $installersRoot > $null |
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
| <!DOCTYPE html> | |
| <head> | |
| <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> | |
| <script src="rx.min.js" type="text/javascript"></script> | |
| <script src="rx.jquery.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| $(function () { | |
| var dragTarget = $('#dragTarget') |
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
| require 'sinatra' | |
| require 'action_mailer' | |
| class Mailer < ActionMailer::Base | |
| def contact | |
| mail( | |
| :to => "test@example.com", | |
| :from => "test@example.com", | |
| :subject => "Test") do |format| | |
| format.text |
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
| Copyright (C) 2011 by Colin MacKenzie IV | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in |
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
| # Adds .previous and .next class methods to your model treating the records in your database like a sequential list | |
| # | |
| # Put this in your model definition: | |
| # acts_as_sequential :column => :created_at # you can also use the :dir => 'DESC' option (ASC is the default) | |
| # | |
| # Then use it like this: | |
| # Model.next(current_record) -> next record in sequence | |
| # Model.other_named_scope.previous(current_record) -> previous record in sequence | |
| # |
NewerOlder