This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sending emails from a Gmail account using Go can be done using Go's smtp package. Simply:
- Connect to
smtp.gmail.com
on port 587, authenticating using your email and password - Optionally, use Go's
text/template
package to format theTo
,From
,Subject
, andBody
fields of your email - Use
smtp
'sSendMail
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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>, |
Install from the AUR.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/negroni" | |
"github.com/julienschmidt/httprouter" | |
"net/http" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |