Skip to content

Instantly share code, notes, and snippets.

@gjtorikian
gjtorikian / main.go
Created October 13, 2020 15:43
Heroku chat sample
package main
import (
"encoding/json"
"io"
"log"
"net/http"
"os"
"github.com/go-redis/redis"
@SamantazFox
SamantazFox / winlang.h
Created May 3, 2020 12:09
Header containing all the languages codes used in Microsoft Windows programs
/*
* winlang.h
*
* Language Identifier Constants and Strings for Microsoft Windows
*
* Extracted from:
* https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings
*
* Disclaimer: As the data below was extracted from Microsoft website, I'm NOT
* responsible for any geo-political issues that may come from their sorting
@BoQsc
BoQsc / Gists.md
Last active June 10, 2024 19:02
How to search my own Gists

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@doobeh
doobeh / button_field_example.py
Created February 17, 2016 21:01
WTForms ButtonField Example
from flask import Flask, render_template_string
from flask_wtf import Form
from wtforms import StringField
from wtforms.widgets import html_params, HTMLString
app = Flask(__name__)
app.secret_key = 'SHH!'
class ButtonWidget(object):
@nitoyon
nitoyon / rgb.go
Created January 1, 2016 16:08
Generate Animation GIF with Golang
package main
import (
"fmt"
"image"
"image/color"
"image/gif"
"math"
"os"
)
@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@sagarsane
sagarsane / selfcalling_setTimeout.js
Created September 10, 2012 02:25
Self calling functions + setTimeout instead of setInterval
/*
This is very useful and smoother (feels like at least) when you want to do something like live updates on the UI or something (thinking Windows 8 UI styling?)
*/
(function better(){
//logic here
setTimeout(better, 100);
})();