Skip to content

Instantly share code, notes, and snippets.

/**
* Performs a list of callable actions (promise factories) so that only a limited
* number of promises are pending at any given time.
*
* @param listOfCallableActions An array of callable functions, which should
* return promises.
* @param limit The maximum number of promises to have pending at once.
* @returns A Promise that resolves to the full list of values when everything is done.
*/
function throttleActions(listOfCallableActions, limit) {
@hmrtk
hmrtk / project.sublime-project
Created May 5, 2015 16:31
Sublime Project Setting for Angular Project using Karma as Test Runner
{
"folders": [{
"follow_symlinks": true,
"path": "."
}],
"settings": {
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"file_exclude_patterns": [
@hmrtk
hmrtk / README.md
Last active August 29, 2015 14:17 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@hmrtk
hmrtk / gist:f2ce80577df032513c28
Created February 18, 2015 15:44
Opening github compare from command line
git symbolic-ref HEAD |
sed -e "s/^refs\/heads\///" |
awk '{printf "https://github.com/USERACCOUNT/REPOSITORY-NAME/compare/%s?expand=1",$1}' |
xargs open
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
@model Tuple<LoginViewModel,RegisterViewModel>
@using (Html.BeginForm("Login1", "Auth", FormMethod.Post))
{
@Html.TextBoxFor(tuple => tuple.Item2.Name, new {@Name="Name"})
@Html.TextBoxFor(tuple => tuple.Item2.Email, new {@Name="Email"})
@Html.PasswordFor(tuple => tuple.Item2.Password, new {@Name="Password"})
}
@using (Html.BeginForm("Login2", "Auth", FormMethod.Post))