Skip to content

Instantly share code, notes, and snippets.

@guyboltonking
guyboltonking / GNUmakefile
Last active December 16, 2015 07:38
Fluent C++; in response to a challenge from Russel Winder's lightning talk at ACCU 2013
all: run-boost-range
run-boost-range: boost-range
./boost-range
boost-range: boost-range.cpp
clang++ -std=c++0x -Iboost_1_53_0 -o boost-range boost-range.cpp
@pascalpoitras
pascalpoitras / config.md
Last active June 6, 2024 13:09
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@nathanleclaire
nathanleclaire / SendingEmailsWithGolang.md
Last active February 24, 2016 19:21
More terse, technical definition of how to send emails using Golang.

Sending emails from Gmail Using Golang

Sending emails from a Gmail account using Go can be done using Go's smtp package. Simply:

  1. Connect to smtp.gmail.com on port 587, authenticating using your email and password
  2. Optionally, use Go's text/template package to format the To, From, Subject, and Body fields of your email
  3. Use smtp's SendMail method to actually send the email

An example usage follows. The SmtpTemplateData struct is used to hold the context for the templating mentioned in (2) above.

/// Phantom type for step 1.
pub enum Step1 {}
/// Phantom type for step 2.
pub enum Step2 {}
/// Contains data we set step by step.
pub struct Data<'a> {
/// 'a' is set in the first step.
a: Option<int>,
@bitjockey42
bitjockey42 / mopidy.md
Created April 20, 2014 16:39
An installation and setup guide for mopidy on Arch Linux.

Mopidy on Arch Linux

mopidy

Installation

Install from the AUR.

@jakejscott
jakejscott / server.go
Created May 20, 2014 00:53
negroni + httprouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
"net/http"
)
func main() {
@dwilliamson
dwilliamson / gist:e9b1ba3c684162c5a931
Last active December 20, 2021 19:38
Workflow for using git subtree on Windows
To include a library as a subtree, follow these steps:
1. Add the project as a remote
git remote add <remote-name> <source-repo>
2. Fetch the remote
git fetch <remote-name>
3. Add the project
git subtree add --prefix "path/to/project" <remote-name> <remote-branch-name> --squash
@sdiehl
sdiehl / preamble.hs
Last active February 1, 2016 20:16
Modern Haskell Preamble
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
@phybros
phybros / update-route53.sh
Last active February 12, 2024 00:07
BASH Script to keep Route53 updated with your current external IP address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="enter zone id here"
# The CNAME you want to update e.g. hello.example.com
namespace api
{
namespace blah
{
// Opaque handle to the type this namespace exposes functions for
struct Blah;
// Lifetime management (malloc/free with construct/destruct)
Blah* New(u32 param);