Skip to content

Instantly share code, notes, and snippets.

View sevkin's full-sized avatar

Vsevolod Balashov sevkin

View GitHub Profile
@Integralist
Integralist / hash.js
Created January 12, 2012 10:27
Detect `onhashchange` support
var docmode = document.documentMode;
// Does the browser support window.onhashchange?
// Note that IE8 running in IE7 compatibility mode reports true for 'onhashchange' in window,
// even though the event isn't supported, so also test document.documentMode.
if ('onhashchange' in window && (docmode === undefined || docmode > 7 )) {
window.onhashchange = checkHash;
}
// IE7 doesn't support the hashchange event so we fall back to standard polling technique
else {
@sandys
sandys / IE8_on_ubuntu.md
Created June 20, 2012 06:40
Installing IE8 on Ubuntu 12.04 64-bit (and avoiding the 32/64 bit architecture error)
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active September 24, 2024 14:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@mpetroff
mpetroff / photo-sphere.txt
Created November 5, 2012 21:24
Exiv2 Google Photo Sphere command file
# Exiv2 Google Photo Sphere command file
# -------------------------
#
# $ exiv2 -m photo-sphere.txt file ...
reg GPano http://ns.google.com/photos/1.0/panorama/
set Xmp.GPano.UsePanoramaViewer XmpText True
set Xmp.GPano.ProjectionType XmpText equirectangular
set Xmp.GPano.CroppedAreaImageWidthPixels XmpText 4096
@ksafranski
ksafranski / SimpleStore.js
Last active July 2, 2022 15:25
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@andelf
andelf / sendMail.go
Last active September 20, 2023 15:13
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"
@Macil
Macil / local.usr.bin.skype
Last active January 31, 2017 06:14
Skype AppArmor profile(tested with Ubuntu 14.10 and Skype 4.3)
#include <tunables/global>
/usr/bin/skype {
#include <abstractions/base>
#include <abstractions/user-tmp>
#include <abstractions/audio>
#include <abstractions/nameservice>
#include <abstractions/ssl_certs>
#include <abstractions/fonts>
#include <abstractions/ibus>
#include <abstractions/dbus>
@andelf
andelf / sighup.go
Created June 29, 2013 05:25
golang process SIGHUP, HUP signal to reload configuration
// program
package main
import "os/signal"
import "os"
import "fmt"
import "syscall"
import "time"
@gregrickaby
gregrickaby / html5-schema.org-markup.html
Last active August 2, 2022 00:05
Proper SCHEMA.ORG markup
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI