Here's what I did to get things working.
Yep, over at: https://developer.apple.com
FROM trenpixster/elixir | |
WORKDIR /app | |
ADD http://s3.amazonaws.com/s3.hex.pm/installs/1.1.0/hex-0.14.0.ez /tmp/ | |
RUN mix archive.install --force /tmp/hex-0.14.0.ez |
document.addEventListener( 'DOMContentLoaded', function () { | |
function cachetAlert(cachetUrl) { | |
var createAlert = function(incident) { | |
var divElement = document.createElement('div'); | |
divElement.id = 'cachet-alert'; | |
divElement.setAttribute('style', 'background-color: #FF3D2E; text-align: center; font-family: sans-serif;'); | |
divElement.innerHTML = '<a style="color: #fff; display: block; padding: 5px;" href="'+ cachetUrl +'" target="_blank">'+ incident.name +'</a>'; | |
document.body.insertBefore(divElement, document.body.children[0]); | |
}; |
Code.load_file("computation.ex") | |
Code.load_file("aggregator.ex") | |
defmodule AsyncNoLink do | |
def run do | |
:random.seed(:os.timestamp) | |
Task.Supervisor.start_link(name: :task_supervisor) | |
1..10 | |
|> Enum.map(fn(_) -> :random.uniform(1000) - 500 end) |
To change a field name in django 1.7+ | |
1. Edit the field name in the model (but remember the old field name: you need it for step 3!) | |
2. Create an empty migration | |
$ python manage.py makemigrations --empty myApp | |
3. Edit the empty migration (it's in the migrations folder in your app folder, and will be the most recent migration) by adding | |
migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'), | |
to the operations list. |
/** @jsx React.DOM */ | |
var Comment = React.createClass({ | |
render: function () { | |
return ( | |
<div className="comment"> | |
<h2 className="commentAuthor"> | |
{this.props.author} | |
</h2> | |
{this.props.comment} | |
</div> |
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
// In app.js or main.js or whatever: | |
// var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
// This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
myApp.filter('percentage', ['$filter', function ($filter) { | |
return function (input, decimals) { | |
return $filter('number')(input * 100, decimals) + '%'; | |
}; | |
}]); |
// Deep Breaths // | |
////////////////// | |
// Gulp | |
var gulp = require('gulp'); | |
// Sass/CSS stuff | |
var sass = require('gulp-sass'); | |
var prefix = require('gulp-autoprefixer'); | |
var minifycss = require('gulp-minify-css'); |
What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];