Instantly share code, notes, and snippets.

View atom_snippets.cson
# Your snippets
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
# An example CoffeeScript snippet to expand log to console.log:
View concurrent_file_downloader.go
package phttp
import (
View ad_accounts_fb.js
var main_page_id = "1235324234324"
var page_url = "";
fb.api('/oauth/access_token', {
client_id: config.facebook_api_key,
client_secret: config.facebook_api_secret,
redirect_uri: 'https://localhost:4430/auth/callback',
code: req.query.code // FYI, we're in an express.js handler
}, function(res_accesstoken) {
if (!res_accesstoken || res_accesstoken.error) {
View gist:c1b19a39c0add210d4a5d36f760f11b6

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.


View Dockerfile1
# Sample from @citizen428
FROM golang:alpine as build
RUN apk add --no-cache ca-certificates
WORKDIR /build
ADD . .
go build -ldflags '-extldflags "-static"' -o app
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt \
View templates.go
// Note that the templateFuncs refer to my apps helper package, left here
// in this example to help.
// Heavily inspired by the book
package templates
import (
View template_test.go
package main
import (
var layout = `layout: {{block "home" .}}default{{end}}`
View debounce.go
package main
import (
func main() {
f := func(args ...interface{}) {
View domain_lookup_spamhaus.php
$domains = [
foreach ($domains as $domain) {
View git_overview
find . -type d -name '.git' | while read dir ; do sh -c "cd $dir/../ && echo -e \"\nGIT STATUS IN ${dir//\.git/}\" && git status -s" ; done