Skip to content

Instantly share code, notes, and snippets.

View arkan's full-sized avatar

Florian Bertholin arkan

View GitHub Profile
func consumer(connection *amqp.Connection, channel *amqp.Channel, queue amqp.Queue) {
log.Print("This is the consumer")
deliveries, err := channel.Consume(queue.Name,
"", // queue
true, // consumer
false, // autoAck
false, // exclusive
false, // noLocal
nil, // NoWait
@zishe
zishe / app.go
Created April 3, 2014 02:02
martini simple server
package main
import (
"github.com/go-martini/martini"
"github.com/martini-contrib/render"
"runtime"
)
type myClassic struct {
*martini.Martini
class Ticket < ActiveRecord::Base
belongs_to :grouper
belongs_to :user
validate :user_cant_be_blacklisted, on: :confirmation
validate :user_cant_double_book, on: :confirmation
validate :grouper_cant_be_full, on: :confirmation
validate :grouper_cant_have_occurred, on: :confirmation
@thoughtchad
thoughtchad / jdk8_jruby_rails_startup.txt
Last active August 29, 2015 13:57
java 8, jruby 1.7.11, rails 4, startup times, jvm options
JAVA 8
export JRUBY_OPTS=--2.0
export JAVA_OPTS=
time bundle exec rake environment
157.76s user 13.05s system 270% cpu 1:03.15 total
export JRUBY_OPTS=--2.0
export JAVA_OPTS="-XX:TieredStopAtLevel=1 -XX:CICompilerCount=3 -Djruby.jit.threshold=500 -XX:+TieredCompilation -noverify -XX:+UseG1GC -XX:ReservedCodeCacheSize=256m -Xss2048k -Xms2048m -Xmx2048m"
time bundle exec rake environment
43.18s user 8.15s system 132% cpu 38.839 total
@jakejscott
jakejscott / server.go
Created February 12, 2014 07:11
oauth2 martini google
package main
import (
"github.com/codegangsta/martini"
"github.com/martini-contrib/oauth2"
"github.com/martini-contrib/sessions"
)
func main() {
m := martini.Classic()
@XVilka
XVilka / TrueColour.md
Last active May 28, 2024 17:42
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@manishtpatel
manishtpatel / main.go
Last active October 18, 2023 03:12
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@protocol TLSwipeForOptionsCellDelegate <NSObject>
/**
Tells the delegate that the specified cell’s menu is now shown or hidden.
@param cell The cell whose menu was shown or hidden.
@param isShowingMenu `YES` if the menu was shown; otherwise, `NO`.
*/
- (void)cell:(TLSwipeForOptionsCell *)cell didShowMenu:(BOOL)isShowingMenu;