Skip to content

Instantly share code, notes, and snippets.

View liesislukas's full-sized avatar
🚀
Excited

Lukas Liesis liesislukas

🚀
Excited
View GitHub Profile
@liesislukas
liesislukas / moment-js-timezones.js
Last active March 15, 2020 14:37
timezones from moment.js timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@liesislukas
liesislukas / config.js
Created February 29, 2020 20:21
npm_lazy (local cache server for npm)
// npm_lazy config
module.exports = {
// Logging config
loggingOpts: {
// show the ip address of the machine requesting the npm package
logRequesterIP: true,
// Print to stdout with colors
logToConsole: true,
@liesislukas
liesislukas / gist:31f89a179d789600336b8992d2af646b
Created January 26, 2020 16:53
resize disk space with google cloud, AWS or any other
sudo lsblk
sudo df -h
sudo growpart /dev/sda 1 <-- disk to grow to new available space
sudo resize2fs /dev/root <-- file system to grow to available space
@liesislukas
liesislukas / paypal sample create order with items.js
Created August 9, 2019 09:43
Working PayPal order capture sample code. JavaScript. createOrder with items
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [
{
reference_id: "PUHF",
description: "Some description",
custom_id: "Something7364",
soft_descriptor: "Great description 1",
@liesislukas
liesislukas / express_after_response.js
Created July 15, 2019 16:23
express nodejs after response listener sample
app.use(function (req, res, next) {
function afterResponse() {
res.removeListener('finish', afterResponse);
res.removeListener('close', afterResponse);
var log = logger.loggerInstance.child({
id: req.id
}, true)
log.info({res:res}, 'response')
}
res.on('finish', afterResponse);
(function(d, e, id) {
function s() {var js, a = d.getElementsByTagName("script")[0];js = d.createElement("script");js.id = id;js.src = "//connect.emojics.com/dist/sdk.js";a.parentNode.insertBefore(js, a);}
window.emojics=e;e.readyQueue=[];e.ready=function(b){e.readyQueue.push(b)}
window.attachEvent?window.attachEvent("onload",s):window.addEventListener("load",s)
})(document, window.emojics||{}, "emojics-js");
emojics.ready(function() {
console.log('Emojics Ready');
// The following event will fire whenever a visitor clicks on a reaction.

From: https://beta.psy-dreamer.com/category/automation/deploying-from-github-to-vps-using-travis-ci

Recently, I spent around 14 to 16 hours learning all of the necessary steps to getting an existing repo set up with Travis CI to run unit tests, and then once successful, connect to a remote server that isn't a PaaS (in this case, Linode) and then proceeds to use Git hooks to do post deployment things.

Starting with your local machine and you have your project already checked out from Github.

Setting Up

  • Assuming you have Ruby (at least 2.3.1) installed, run gem install travis. This installs the Travis CI command-line tools. We're going to use these tools to encrypt RSA keys that Travis will use to connect to your remote server.
  • This tutorial also assumes that you have a working repo and a Travis-CI account set up.
@liesislukas
liesislukas / generate_load.sh
Created October 26, 2018 07:40
generate load on server
sha1sum /dev/zero | sha1sum /dev/zero
@liesislukas
liesislukas / Immutable JS Examples
Created October 24, 2018 07:09 — forked from singhshivam/Immutable JS Examples
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@liesislukas
liesislukas / Docker shell commands.sh
Created August 11, 2018 00:21 — forked from bahmutov/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .