Skip to content

Instantly share code, notes, and snippets.

@jedy
jedy / verify.go
Created July 10, 2013 05:10
use publib key to verify in golang
package main
import (
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"fmt"
)

Cached version of http://unix-heaven.org/proxmox-ve-kvm-template

How to create a KVM template in Proxmox VE

Wed, 10/31/2012 - 19:01 — dnaeon

Probably this is something that most people working with Proxmox VE have stumbled upon.

In Proxmox VE you can only use (at least for now) OpenVZ templates. If you are intrested in running Proxmox VE with KVM (as I was), then you will be surprised that the only supported templates are for OpenVZ.

@roktas
roktas / angular-xeditable-example.markdown
Created November 5, 2013 23:51
A Pen by Recai Oktaş.
@GianlucaGuarini
GianlucaGuarini / post-merge
Last active February 13, 2025 13:38 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
class GroupersController < ApplicationController::Base
def create
@grouper = Grouper.new(leader: current_member)
if @grouper.save
ConfirmedGrouperEmails.new(@grouper).deliver
AssignBarForGrouper.enqueue(@grouper.id)
redirect_to home_path
else
@getify
getify / gist:9895188
Last active August 17, 2016 23:51
composition vs. delegation
// composition
var obj1 = {
doSomething: function(myId) {
console.log( "Something: " + myId() );
}
};
var obj2 = {
id: "obj2",
@roktas
roktas / freq.sh
Last active August 29, 2015 13:58
Read a file of text, determine the n most frequently used words, and print out a sorted list of those words along with their frequencies.
#!/bin/sh
# http://franklinchen.com/blog/2011/12/08/revisiting-knuth-and-mcilroys-word-count-programs/
# http://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692
tr -cs A-Za-z '\n' |
tr A-Z a-z |
sort |
uniq -c |
sort -rn |
sed ${1}q
package main
import (
"log"
"net/http"
"os"
)
var port = "8080"
var root = "."
@davecheney
davecheney / bm_test.go
Last active May 10, 2024 18:30
Which is faster ? map[string]bool or map[string]struct{} ?
package bm
import (
"testing"
)
var mb = map[string]bool{
"alpha": true,
"beta": true,
"gamma": true,
@cspeer
cspeer / config_initializers_willPaginateRenderer.rb
Last active June 28, 2017 22:22
Will Paginate Semantic UI Renderer
require 'will_paginate/view_helpers/link_renderer'
module WillPaginate
module ViewHelpers
class LinkRenderer
protected
def page_number(page)
page == current_page ? tag(:span, page, class: 'active item') : link(page, page, class: 'item', rel: rel_value(page))
end