Using:
This file contains 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
'use strict'; | |
angular.module('yourApp') | |
.constant('Config', { | |
view_dir: 'views/', | |
API: { | |
useMocks: true, | |
fakeDelay: 2000, | |
protocol: window.location.protocol.split(':')[0], | |
host: window.location.hostname, |
This file contains 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> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://snapsvg.io/assets/js/snap.svg-min.js"></script> | |
<style id="jsbin-css"> | |
#svgout { | |
height: 600px; | |
} |
This file contains 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
#!/bin/sh | |
# | |
# Upload image(s) to imgur.com | |
# Copyright (C) 2014 Vivien Didelot <[email protected]> | |
# Licensed under GPL version 3, see http://www.gnu.org/licenses/gpl.txt | |
# | |
# Requires "jshon": | |
# http://kmkeen.com/jshon/ | |
# | |
# Alternatives, which suck: |
This file contains 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
angular.module('hf.events.builder', [ | |
'app.resources', | |
'app.values' | |
]) | |
.factory('EventBuilder', function ($injector, $window, apiUrl) { | |
var EventBuilder = function EventBuilder(message) { | |
this['@timestamp'] = new Date(); | |
this['@message'] = message || ''; | |
return this; | |
}; |
This file contains 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
# Varnish caching | |
## List of 300 items | |
Requests per second: 6717.35 [#/sec] (mean) # RESTful Memcache render cache. | |
Requests per second: 7096.14 [#/sec] (mean) # RESTful Database render cache. | |
Requests per second: 6379.45 [#/sec] (mean) # RESTful No render cache. | |
Requests per second: 95.24 [#/sec] (mean) # RESTWS | |
Requests per second: 1125.62 [#/sec] (mean) # Services | |
## List of 50 items | |
Requests per second: 6632.03 [#/sec] (mean) # RESTful Memcache render cache. | |
Requests per second: 7057.74 [#/sec] (mean) # RESTful Database render cache. |
This file contains 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: php | |
# | |
# Important to note, this is the version of PHP used to run this build, not the | |
# one used to run your Drupal installation. Ensure compatibility with the Drush | |
# and Terminus versions you're using for this build. | |
# | |
php: | |
- 5.3 |
This file contains 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
module Main exposing (..) | |
import Html exposing (Html, div, li, text, ul) | |
main : Html a | |
main = | |
div [] | |
[ div [] [ text <| "Showing contacts for language " ++ toString model.language ] | |
, viewContacts model.language model.contacts |
This file contains 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
module Main exposing (..) | |
import Html exposing (Html, div, li, text, ul) | |
import Json.Decode as Json exposing (Decoder, andThen, at, fail, int, list, map, nullable, string, succeed) | |
import Json.Decode.Pipeline exposing (custom, decode, hardcoded, optional, required) | |
import String exposing (join) | |
main : Html a | |
main = |
This file contains 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
// go to https://demo.openmrs.org, log in as admin/Admin123, open the JavaScript console, and do the following: | |
var URL_BASE = "https://demo.openmrs.org/openmrs/ws/rest/v1/"; | |
var resources = {}; | |
function andLog(data) { console.log(data); } | |
function andSaveAs(variable) { return function(data) { resources[variable] = data; console.log(variable + " => " + JSON.stringify(data)); } } | |
function andSaveFirstResultAs(variable) { return function(data) { data = data.results[0]; resources[variable] = data; console.log(variable + " => " + JSON.stringify(data)); } } | |
function random() { return Math.floor(Math.random() * 10000); } | |
function post(resource, data, success) { | |
$.ajax({ type: "POST", url: URL_BASE + resource, contentType: "application/json", data: JSON.stringify(data), success: success }); |
OlderNewer