Skip to content

Instantly share code, notes, and snippets.

---
- hosts: ec2
vars:
timestamp: "{{ lookup('pipe', 'date +%Y%m%d\\ %H%M%S') }}"
roles:
- include: includes/common_roles.yml
pre_tasks:
@icub3d
icub3d / example_wrapio.go
Created January 25, 2014 01:49
An example of wrapio
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"github.com/icub3d/wrapio"
"io"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ext JS Grid Example</title>
<script src="http://cdn.sencha.io/ext-4.0.7-gpl/ext-all.js"> </script>
<link rel="stylesheet" href="http://cdn.sencha.io/ext-4.0.7-gpl/resources/css/ext-all.css" />
@tg123
tg123 / README.md
Created November 9, 2013 02:32
自动订餐脚本 :) 现在刷失效了 开放出来
@temoto
temoto / meetup.go
Last active November 24, 2017 20:20
Meetup is a micro proxy program that enables to connect two endpoints via TCP sockets. https://github.com/temoto/meetup
// Moved to https://github.com/temoto/meetup
@hash
hash / ideas.txt
Last active December 26, 2015 06:39
Go Package Management
Go Package Management
interface type version
type version interface {
string Version()
}
@mrvdot
mrvdot / jsonphandler.go
Last active December 21, 2015 10:58
If you've ever wanted to handle JSONP callbacks within a Go powered API, here's a simple wrapper that you can use to intercept the callback query variable and properly wrap the response. It's designed to take an entire http.Handler, so works particularly well when using a router such as mux from gorilla, however can work with any handler.
import (
"io"
"net/http"
)
//With HandlerFunc
func main () {
http.Handle("/", JsonpHandler(http.HandlerFunc(func (w http.ResponseWriter, r *http.Request) {
w.Write("Hello World")
})))
@andreagrandi
andreagrandi / gdata_read.py
Last active October 30, 2019 22:30
Read a Google Docs spreadsheet document from Python.
# Copyright (c) 2013, Andrea Grandi and individual contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1) Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2) Redistributions in binary form must reproduce the above copyright notice,
@hugozhu
hugozhu / du.go
Last active December 20, 2015 14:29
Another Go script to count folder size
package main
import (
"fmt"
"os"
"runtime"
"sync"
"sync/atomic"
"time"
)
@yinian1992
yinian1992 / count_last_24.py
Last active January 20, 2021 13:22
SqlAlchemy Example / Count submits in each of the last 24 hours.
from datetime import datetime, timedelta
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
NOW = datetime.utcnow()
DBSession = scoped_session(sessionmaker())
Base = declarative_base()