Skip to content

Instantly share code, notes, and snippets.

Hasan Tayyar BEŞİK hasantayyar

Block or report user

Report or block hasantayyar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hasantayyar /
Created Aug 25, 2017 — forked from bastman/
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
hasantayyar / simple-promise-retry.js
Created Aug 7, 2017 — forked from briancavalier/simple-promise-retry.js
A few general patterns for retries using promises
View simple-promise-retry.js
function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);
hasantayyar / postal-codes.json
Created Jun 15, 2017 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
View postal-codes.json
[{ "Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup", "Country": "Afghanistan", "ISO": "AF", "Format": "NNNN", "Regex": "^\\d{4}$"}, { "Note": "With Finland, first two numbers are 22.", "Country": "Åland Islands", "ISO": "AX", "Format": "NNNNN", "Regex": "^\\d{5}$"}, { "Note": "Introduced in 2006, gradually implemented throughout 2007.", "Country": "Albania", "ISO": "AL", "Format": "NNNN", "Regex": "^\\d{4}$"}, { "Note": "First two as in ISO 3166-2:DZ", "Country": "Algeria", "ISO": "DZ", "Format": "NNNNN", "Regex": "^\\d{5}$"}, { "Note": "U.S. ZIP codes (range 96799)", "Country": "American Samoa", "ISO": "AS", "Format": "NNNNN (optionally NNNNN-NNNN or NNNNN-NNNNNN)", "Regex": "^\\d{5}(-{1}\\d{4,6})$"}, { "Note":
hasantayyar /
Created Jun 8, 2017 — forked from eladnava/
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
# Make sure to:
# 1) Name this file `` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x
# 7) Test it out via ./
hasantayyar /
Created May 11, 2017 — forked from wearhere/
CI script to convert a Meteor application into a Node.js application then deploy it to AWS Elastic Beanstalk.
# This script will convert a Meteor application into a Node.js application
# then deploy it to AWS Elastic Beanstalk.
# Run like ` my_eb_app my_eb_app-production`.
# That will deploy the Meteor application containing this script
# to the `my_eb_app-production` environment of the `my_eb_app` EB application.
View jsbin-template.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src="//"></script>
<script src="//"></script>
<meta charset="utf-8">
<title>JS Bin</title>
hasantayyar / get-social-shares
Created May 16, 2016 — forked from ihorvorotnov/get-social-shares
Get number of shares from social platforms
View get-social-shares
+ works, returns shares, likes, comments and total
+ v1 API but still works
import sys, marshal, functools, subprocess
child_script = """
import marshal, sys, types;
fn, args, kwargs = marshal.load(sys.stdin)
types.FunctionType(fn, globals())(*args, **kwargs),
hasantayyar /
Created Mar 27, 2016 — forked from dergachev/
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

View PeerConnectionImpl.js
function PeerConnectionImpl(originId,targetId,initiator,reliability){
this.reliable = reliability;
this.originId = originId;
this.targetId = targetId;
//you can use adapter.js instead
if (window.webkitRTCPeerConnection) {
this.RTCPeerConnection = webkitRTCPeerConnection;
this.RTCSessionDescription = RTCSessionDescription;
} else if (window.mozRTCPeerConnection) {
//delete turn servers due to incompatablitiy now
You can’t perform that action at this time.