Skip to content

Instantly share code, notes, and snippets.

View feyyazesat's full-sized avatar

Feyyaz Esatoglu feyyazesat

View GitHub Profile
@feyyazesat
feyyazesat / connectionpooling.go
Last active August 29, 2015 14:17 — forked from rday/gist:3504674
An example of connection pooling.
type InitFunction func() (interface{}, error)
type ConnectionPoolWrapper struct {
size int
conn chan interface{}
}
/**
Call the init function size times. If the init function fails during any call, then
the creation of the pool is considered a failure.
@feyyazesat
feyyazesat / ymlstruct.go
Created March 9, 2015 00:26
simmetrica graph yaml struct
type Yaml struct {
Graphs []struct {
Title string
Timespan string
Colorscheme string
Type string
Interpolation string
Resolution string
Size string
Offset string
- http://www.alexedwards.net/blog/golang-response-snippets
- https://devcharm.com/articles/8/go-nethttp-handlers/
- http://openmymind.net/Things-I-Wish-Someone-Had-Told-Me-About-Go/
- https://elithrar.github.io/article/custom-handlers-avoiding-globals/
- https://elithrar.github.io/article/map-string-interface/
- https://elithrar.github.io/article/approximating-html-template-inheritance/
- http://blog.golang.org/error-handling-and-go
- https://golang.org/doc/articles/wiki/
- https://medium.com/@benbjohnson/structuring-applications-in-go-3b04be4ff091
- https://justinas.org/best-practices-for-errors-in-go/
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)
@feyyazesat
feyyazesat / sf2Exceptions
Created September 23, 2014 18:17
Symfony 2 Exception List
Symfony/Component/OptionsResolver/Exception/MissingOptionsException.php
Symfony/Component/OptionsResolver/Exception/OptionDefinitionException.php
Symfony/Component/OptionsResolver/Exception/InvalidOptionsException.php
Symfony/Component/Serializer/Exception/InvalidArgumentException.php
Symfony/Component/Serializer/Exception/UnsupportedException.php
Symfony/Component/Serializer/Exception/UnexpectedValueException.php
Symfony/Component/Serializer/Exception/LogicException.php
Symfony/Component/Serializer/Exception/Exception.php
Symfony/Component/Serializer/Exception/RuntimeException.php
Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php
{
"events":[
{
"title":"the foo party",
"lat":1111,
"long":1111,
"description":"go to the party, surely you will have fun!",
"startDate":1111 // unixtimestamp
}
]