Skip to content

Instantly share code, notes, and snippets.

View jaymecd's full-sized avatar

Nikolai Zujev jaymecd

View GitHub Profile
@jaymecd
jaymecd / redirectExample.go
Created October 11, 2016 21:20 — forked from d-schmidt/redirectExample.go
How to redirect HTTP to HTTPS with a golang webserver.
package main
import (
"net/http"
)
func redirect(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req,
"https://" + req.Host + req.URL.String(),
http.StatusMovedPermanently)
}
@jaymecd
jaymecd / git.md
Created September 30, 2016 07:14

Install git on OSX:

brew update && brew upgrade
brew install git

Make diff nicer:

Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373
@jaymecd
jaymecd / clover-merge.php
Created August 30, 2016 18:57 — forked from YarekTyshchenko/clover-merge.php
Clover XML Merger
<?php
$options = getopt("f:o:");
if (! isset($options['f'])) {
echo "Files have to be specified with -f\n";
exit(1);
}
if (! isset($options['o'])) {
echo "Output has to be specified with -o\n";
exit(1);
}
FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \
@jaymecd
jaymecd / travisci.ext-redis.md
Created July 5, 2016 10:35
Travis CI log with ext-redis Not Found

Travis CI log with ext-redis Not Found

$ phpenv global 5.5 2>/dev/null
5.5 is not pre-installed; installing

$ phpenv global 5.5

$ composer self-update
@jaymecd
jaymecd / php-7_missing_extensions.md
Last active January 29, 2017 09:50
PHP-7: Misssing Extensions

PHP-7: Misssing Extensions

NB! all actions are done on alpine:3.4 within php:7.0.7.

NB! After installation, do not forget to update php.ini with extension={NAME}.so records.

Install build dependencies:

$ apk update
@jaymecd
jaymecd / Doc.gh-release.md
Last active October 9, 2017 12:43
Jira/GitHub release helpers

GitHub / Jira release tool

Install

Download/update scripts:

$ curl https://gist.githubusercontent.com/jaymecd/221af6ff75d7c4b64edae647392b9e86/raw/gh-release.sh > /usr/local/bin/gh-release
$ curl https://gist.githubusercontent.com/jaymecd/221af6ff75d7c4b64edae647392b9e86/raw/gh-release-qa.sh > /usr/local/bin/gh-release-qa
$ chmod +x /usr/local/bin/gh-release*
@jaymecd
jaymecd / latency.markdown
Created May 10, 2016 11:41 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@jaymecd
jaymecd / tmux-cheatsheet.markdown
Created April 22, 2016 05:30 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname