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
// 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) + '%'; | |
}; | |
}]); |
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
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
/** @jsx React.DOM */ | |
var Comment = React.createClass({ | |
render: function () { | |
return ( | |
<div className="comment"> | |
<h2 className="commentAuthor"> | |
{this.props.author} | |
</h2> | |
{this.props.comment} | |
</div> |
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
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. |
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
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) |
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
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]); | |
}; |
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
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 |
OlderNewer