Skip to content

Instantly share code, notes, and snippets.

@umanshield
umanshield / ubuntu_agnoster_install.md
Created January 19, 2020 22:07 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@umanshield
umanshield / datetime.php
Created September 2, 2019 09:26 — forked from graste/datetime.php
PHP DateTime class – parsing and formatting ISO8601 dates with or w/o fractions of a second
<?php
echo 'default locale: ' . \Locale::getDefault();
echo PHP_EOL;
echo 'default timezone: ' . \date_default_timezone_get();
echo PHP_EOL;
// see http://tools.ietf.org/html/rfc3339#section-5.8 for example datetimes
// bug report on missing fractions support: https://bugs.php.net/bug.php?id=51950
// feature request for fractions support in constructor: https://bugs.php.net/bug.php?id=49779
@umanshield
umanshield / compose.js
Created July 18, 2019 20:04 — forked from kirpalmakanga/compose.js
Async Compose & Pipe
const asyncCompose = (…functions) => input => functions.reduceRight((chain, func) => chain.then(func), Promise.resolve(input));
const asyncPipe = (…functions) => input => functions.reduce((chain, func) => chain.then(func), Promise.resolve(input));
@umanshield
umanshield / letsencyrpt_flask.py
Last active March 11, 2019 16:32 — forked from saucecode/my_flask_program.py
how to correctly use a letsencrypt cert with flask
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080, ssl_context=('/etc/letsencrypt/live/<DOMAIN>/fullchain.pem', '/etc/letsencrypt/live/<DOMAIN>/privkey.pem'))
@umanshield
umanshield / PHPStorm-global-menu.md
Created April 14, 2018 09:46 — forked from kiironoaki/PHPStorm-global-menu.md
Global menu for PHPStorm on Ubuntu

Global menu for PHPStorm

Requirements

  1. Ubuntu
  2. PHPStorm

Install jayatana

  1. sudo add-apt-repository ppa:danjaredg/jayatana
  2. sudo apt-get update
  3. sudo apt-get install jayatana
@umanshield
umanshield / bash-cheatsheet.sh
Last active January 7, 2018 19:42 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@umanshield
umanshield / install-comodo-ssl-cert-for-nginx.rst
Created December 4, 2017 23:33 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@umanshield
umanshield / curl.md
Created September 13, 2017 11:29 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@umanshield
umanshield / BasicAuthControllerProvider.php
Created May 17, 2017 14:26 — forked from brtriver/BasicAuthControllerProvider.php
Simple Basic Auth Controller for Silex.
<?php
namespace Silex\Provider;
use Silex\Application;
use Silex\SilexEvents;
use Silex\ControllerProviderInterface;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;