One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
#!/bin/bash | |
go build -ldflags "-X main.buildDate `date -u +%Y-%m-%d.%H%M%S`" |
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see: | |
// http://googleonlinesecurity.blogspot.de/2014/10/this-poodle-bites-exploiting-ssl-30.html | |
import ( | |
"crypto/tls" | |
"net/http" | |
) | |
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2 | |
// Chances are you currently do this but want to stop due to the POODLE | |
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler) |
[url "git@ghe_server.domain.com:"] | |
insteadOf = https://ghe_server.domain.com |
To use, place the code in version_trick.go
in your project. Don't forget to change the namespace to match yours to the actual name of your package.
In addition to version_trick.go
, there's a makefile-snippet, that includes the secret sauce for making this trick
work. Be sure to change the package name there as well.
Enjoy!
P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!
class Marksman < RTanque::Bot::Brain | |
NAME = 'Marksman' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
command.speed = RTanque::Bot::MAX_SPEED | |
nearest = nearest_target() | |
if (!defined?(@direction)) | |
@direction = 0 |
#!/usr/bin/env ruby | |
require 'logger' | |
# rotatelogs required... | |
# http://httpd.apache.org/docs/2.2/programs/rotatelogs.html | |
logger = Logger.new("|rotatelogs ./foo.log.%Y-%m-%d-%H 3600", 0, 0) | |
10.times do | |
logger.error "testing..." |
// A simple sub command parser based on the flag package | |
package subcommand | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
) | |
type subCommand interface { |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
add_line = "config statement" | |
bash "add_to_config" do | |
code <<-EOH | |
grep '#{add_line}' /etc/config || echo '#{add_line}' >> /etc/config | |
EOH | |
end |