Skip to content

Instantly share code, notes, and snippets.

View zignd's full-sized avatar
:shipit:
Writing…

Igor Hipólito Vieira zignd

:shipit:
Writing…
View GitHub Profile
version: '2.1'
services:
php:
tty: true
build:
context: .
dockerfile: tests/Docker/Dockerfile-PHP
args:
version: cli
volumes:
@zignd
zignd / docker-compose.yml
Created September 2, 2021 11:04 — forked from rmoff/docker-compose.yml
Docker-Compose for Kafka and Zookeeper with internal and external listeners
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
@zignd
zignd / openmatrix.sh
Last active November 13, 2019 00:43 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@zignd
zignd / 1-sleep-es7.js
Created January 23, 2017 21:15 — forked from danharper/1-sleep-es7.js
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()
@zignd
zignd / gist:a6282edf63017a9869caefa9ad10e70a
Created January 17, 2017 00:19 — forked from timiles/gist:4445456
Mock HttpContext.Current.Request.Headers. This is ugly but it works. credit: http://bigjimindc.blogspot.co.uk/2007/07/ms-kb928365-aspnet-requestheadersadd.html
HttpContext.Current = new HttpContext(
new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter()));
NameValueCollection headers = HttpContext.Current.Request.Headers;
Type t = headers.GetType();
const BindingFlags nonPublicInstanceMethod = BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance;
t.InvokeMember("MakeReadWrite", nonPublicInstanceMethod, null, headers, null);
t.InvokeMember("InvalidateCachedArrays", nonPublicInstanceMethod, null, headers, null);
@zignd
zignd / configuringmongo.txt
Last active March 23, 2016 15:18 — forked from tamoyal/gist:10441108
Configuring some basic users on MongoDB
# Start the MongoDB server
C:\> mongod
# Start a MongoDB client and create a new admin user
C:\> mongo
> use admin
> db.createUser({ user: "admin", pwd: "123456", roles: [{ role: "root", db: "admin" }]})
# Create a new user for a database of your choice
> use testdb