Skip to content

Instantly share code, notes, and snippets.

View arehmandev's full-sized avatar
🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • Capgemini
  • London, UK
View GitHub Profile
type Func func(key string) (interface{}, error)
type result struct {
value interface{}
err error
}
type entry struct {
res result
ready chan struct{}
@keyle
keyle / HDD.groovy
Created August 4, 2014 10:34
Groovy. Write objects to file (json) and read them back
package utils
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
class HDD {
static save(Object content, String filePath) {
new File(filePath).write(new JsonBuilder(content).toPrettyString())
}
@eduncan911
eduncan911 / main.go
Created July 27, 2014 00:27
Go/Reading Console Inputs
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
@ikaruce
ikaruce / .npmrc
Last active July 12, 2021 08:12
.npmrc( proxy and strict-ssl setting )
proxy http://{proxy_server}:{proxy_port}
https-proxy http://{proxy_server}:{proxy_port}
strict-ssl=false
@d0x2f
d0x2f / .drone.yml
Last active August 17, 2021 22:18
.drone.yml example
workspace:
base: /build
pipeline:
dbnode1:
detach: true
image: mysql/mysql-cluster:7.5
commands:
- sleep 5
@andrestc
andrestc / go-missing-examples.md
Last active September 26, 2021 18:49
Go std lib funcs/methods missing examples

About this

This list has the goal of helping developers interested in contributing to the Go language but are unsure of where to start. This was not generated manually so some functions and methods here may not require examples (maybe because they are too simple, e.g .String()) and some of these may only make sense in a package level example (which are not considered for this list yet). Use your best judgment and check the documentation before you open up a CL to add an example.

You should also search in gerrit for open CLs that are already adding examples.

I will try to keep this list as up to date as possible. If you find any mistakes, please comment below and I will try to fix it.

@zanthrash
zanthrash / JsonBuilderExample.groovy
Created February 12, 2012 02:36
Grails JsonBuilder Example
import groovy.json.*
class Person {
String name
List addresses = []
}
class Address {
String address
String state
@kwmt
kwmt / Castle.xml
Last active November 9, 2021 01:16 — forked from bemasher/Castle.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@arehmandev
arehmandev / consul.groovy
Last active February 25, 2022 08:28
Store keyvalue pair in Consul using groovy (java Ecwid/consul-api)
@Grab( 'com.ecwid.consul:consul-api:1.2.4' )
import com.ecwid.consul.v1.*
client = new ConsulClient("172.20.20.10:8500")
setvalue("Abskey", "Absvalue")
println getvalue("Abskey")
@maksadbek
maksadbek / golang-linked-list.go
Created April 27, 2016 21:43
golang linked list implementation
package main
import "fmt"
type Node struct {
prev *Node
next *Node
key interface{}
}