Instantly share code, notes, and snippets.

View css-media-queries-cheat-sheet.css
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
@media all and (min-width: 1025px) and (max-width: 1280px) {}
@media all and (min-width: 768px) and (max-width: 1024px) {}
@media all and (min-width: 480px) and (max-width: 768px) {}

Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You'll be asked for the content of the CSR file when ordering the certificate.

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr

This gives you two files:

  • example_com.key -- your Private key. You'll need this later to configure ngxinx.


cat > package.json <<EOF
  "name": "test-api",
  "version": "0.1.0",
  "description": "It test the API",
  "main": "index.js",
  "scripts": {
docker run -d --name kong --link postgres -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=postgres" -e "KONG_CASSANDRA_CONTACT_POINTS=postgres" -e KONG_PG_USER=admin -e KONG_PG_DATABASE=mydb -e KONG_PG_PASSWORD=password -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" -e "KONG_PROXY_ERROR_LOG=/dev/stderr" -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" -e "KONG_ADMIN_LISTEN=" -e "KONG_ADMIN_LISTEN_SSL=" -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444 kong:latest
docker run -p 1337:1337 --link kong --link postgres --name konga -e "NODE_ENV=production" -e "DB_ADAPTER=postgres" -e "DB_HOST=postgres" -e "DB_PORT=5432" -e "DB_USER=admin" -e "DB_PASSWORD=password" -e "DB_DATABASE=mydb" pantsel/konga
qemu-img create -f qcow2 hd.qcow2 5G
qemu-system-i386 -boot d -m 512 -hda $PWD/hd.qcow2 -cdrom $PWD/Conectiva6.0.iso -net nic,vlan=0 -net user,vlan=0 -localtime
qemu-kvm -m 16M -drive if=ide,format=qcow2,file=slackware.qcow2 \
-netdev user,id=slirp -device ne2k_isa,netdev=slirp \
-serial stdio -redir tcp:22122::22

add other apt repositories

wget -qO - | sudo apt-key add -
echo "deb apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] xenial stable"

wget -q -O - | sudo apt-key add -
View reverse-proxy.go
package main
import (
func main() {



run server using docker

docker run -d --name postgres -e POSTGRES_DB=third_party_subscription_manager -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -p 5432:5432 postgres:9-alpine
View vanillajs-ajax.js
* GET using promises
function startRequest() {
// show loading
var params = { id: 123 };
makeRequest(params).then(function (body) {
// hide loading
console.log('Response body:', body);
import sys
import base64
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key): = 16
self.cipher =, AES.MODE_ECB)