The stuff before the JSON in heroku logs
output has to be cut off for
bunyan to work.
$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan
Flag -l
makes the output buffered by line.
function defaultCurrencyFromLanguage(){ | |
var lang = window.navigator.userLanguage || window.navigator.language; | |
var symbol = "$"; | |
if(/gb|uk|tr|je|ta|gs|gg|im|sd|sl|vg|cy|eg|fk|gi|lb|sh|ac|ss|sd|sy/i.test(lang)) { | |
symbol = "£"; | |
} | |
else if(/me|sk|ea|gf|tf|bl|mf|ie|ee|re|it|mc|si|de|es|at|yt|gp|pm|cy|pt|fr|gr|ic|be|ad|fi|lu|va|mt|sm|mq|nl|ax|cs/i.test(lang)) { | |
symbol = "€"; | |
} | |
else if(/cn|jp|fm|sj/i.test(lang)) { |
#!/bin/sh | |
if [ -z $1 ]; then | |
echo "Usage: $0 project-location" | |
exit 1 | |
fi | |
if [ ! -d $1 ]; then | |
echo "Could not find your project" | |
exit 2 |
# encoding: utf-8 | |
import sublime, sublime_plugin | |
class DetectSpecialCharacters(sublime_plugin.EventListener): | |
def on_load(self, view): | |
sublime.status_message("detect_special_characters is active") | |
def on_modified(self, view): | |
# find no-break space | |
special_characters = view.find_all(u"\u00A0") |
{ | |
// The number of spaces a tab is considered equal to | |
"tab_size": 2, | |
// Set to true to insert spaces when tab is pressed | |
"translate_tabs_to_spaces": true, | |
"font_face": "Droid Sans Mono", | |
"font_size": 15, |
# -*- coding: utf-8 -*- | |
# Coinbase.com OAuth Authorization PoC | |
# Donncha O'Cearbhaill - 4/05/13 | |
# @DonnchaC | |
# donnchacarroll@gmail.com - PGP: 0xAEC10762 | |
import requests | |
import json | |
from BeautifulSoup import BeautifulSoup | |
from flask import Flask, request, render_template |
test: | |
override: | |
- bundle exec rspec spec | |
deployment: | |
acceptance: | |
branch: master | |
commands: | |
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>: | |
timeout: 300 |
This is not an article on the theoretical proper way to implement a testing policy and/or infrastructure. This is much more real world than that. This is about finding yourself in a situation were you need to refactor or add features to an existing substantial code base. Before undertaking such an adventure you would like to lay down some tests for regression purposes. The hitch is that the code is in a framework that hasn't put testing support first.
Many PHP frameworks qualify for the statement above but the one we will talk about in this article is Codeigniter. I wont use this article to debate the quality of the Codeigniter code base. It is what it is and finds itself used for a very many (in production) websites. What this article is about is addressing the situation that there are many developers out there that may find themselves working on a product utilizing a framework such as Codeigniter
var dgram = require('dgram'); | |
var socket = dgram.createSocket('udp4'); | |
var testMessage = "[hello world] pid: " + process.pid; | |
var broadcastAddress = '255.255.255.255'; | |
var broadcastPort = 5555; | |
socket.setBroadcast(true); | |
socket.bind(broadcastPort, '0.0.0.0'); |
While building a JavaScript single page app that acts as a front-end to multiple backend servers, even if they are on the same host as the web app - but on different ports, you come across CORS issues.
Use a simple node.js + hapi.js server to: