Skip to content

Instantly share code, notes, and snippets.

View erpe's full-sized avatar
🏠
Working from home

rene paulokat erpe

🏠
Working from home
  • AustauschKompass
  • Berlin
  • X @er_pe
View GitHub Profile
@douglasmakey
douglasmakey / sender.go
Last active August 20, 2024 05:40
Golang - send an email with attachments.
package main
import (
"bytes"
"encoding/base64"
"fmt"
"io/ioutil"
"mime/multipart"
"net/smtp"
"os"
@dignoe
dignoe / will_paginate_helper.rb
Last active September 7, 2016 18:39
Add rel="next" & rel="prev" to will_paginate gem (with custom paths)
# config/initializers/will_paginate_helper.rb
# Tested with will_paginate v3.0.7
module WillPaginate
module ActionView
class LinkRenderer < ViewHelpers::LinkRenderer
include ListingHelper
protected
def url(page)
@booherbg
booherbg / gist:f812c9145d157d8945b2
Last active February 25, 2022 23:44
Cross compiling a simple go server for windows

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

@yonggu
yonggu / apache2-unicorn-conf
Last active July 5, 2016 08:54
Apache 2 configuration file with unicorn in Rails 4
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
DocumentRoot /rails_app_directory/public
# Redirect all requests that don't match a file on disk under DocumentRoot get proxied to Puma
RewriteEngine On
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:5100
@jyap808
jyap808 / encrypt_decrypt_gpg_armor.go
Created January 4, 2014 01:12
Symmetrically encrypting a string into ASCII armored GPG format and then Decrypting it in Golang
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"code.google.com/p/go.crypto/openpgp/armor"
"fmt"
"io/ioutil"
"log"
)
@jaybill
jaybill / copytree.go
Created June 5, 2012 17:46
How to copy a directory tree (preserving permissions) in Go.
package main
import "fmt"
import "os"
import "io"
import "io/ioutil"
import "log"
// Copies file source to destination dest.
func CopyFile(source string, dest string) (err error) {
@LRDesign
LRDesign / deploy.rb
Created March 21, 2010 18:22 — forked from netzpirat/deploy.rb
Capistrano recipe to sync rails database and files, using remote database.yml instead of local for remote credentials
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3