This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*@Annotation | |
*/ | |
class AnnotatedDescription | |
{ | |
public $value; | |
public $type; | |
public $desc; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package middlewares | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
func Recovery(next http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib, sys, bs4 | |
print bs4.BeautifulSoup(urllib.urlopen("http://data.alexa.com/data?cli=10&dat=s&url="+ sys.argv[1]).read(), "xml").find("REACH")['RANK'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="custom" | |
# Example aliases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wait(signal, ms) { | |
return new Promise((res, rej) => { | |
const timeOut = setTimeout(() => { | |
console.log("I was called"); | |
res("ok"); | |
}, ms); | |
signal.catch(err => { | |
rej(err); | |
clearTimeout(timeOut); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RangeIterator implements Iterator<number> { | |
constructor(private n: number, private to: number) {} | |
next(): IteratorResult<number> { | |
if (this.n <= this.to) { | |
return { done: false, value: this.n++ }; | |
} else { | |
return { done: true, value: undefined }; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"github.com/masnun/gopher-and-rabbit" | |
"github.com/streadway/amqp" | |
"log" | |
"math/rand" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"log" | |
"os" | |
gopher_and_rabbit "github.com/masnun/gopher-and-rabbit" | |
"github.com/streadway/amqp" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"net/http" | |
"github.com/go-chi/chi" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from "fs"; | |
import * as AWS from "aws-sdk"; | |
const BUCKET_NAME = "<<bucket name>>"; | |
const IAM_USER_KEY = "<<user key>>"; | |
const IAM_USER_SECRET = "<<user secret>>"; | |
const s3bucket = new AWS.S3({ | |
accessKeyId: IAM_USER_KEY, | |
secretAccessKey: IAM_USER_SECRET |
NewerOlder