Skip to content

Instantly share code, notes, and snippets.

View viztastic's full-sized avatar
🏠
Working from home

Ahmed viztastic

🏠
Working from home
View GitHub Profile
@adamgen
adamgen / timedatectl list-timezones
Created April 10, 2017 09:36
An online display timedatectl list-timezones list
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
@mikeparisstuff
mikeparisstuff / compose.js
Last active May 12, 2017 03:35
A simple functional compose implementation in javascript.
export function compose(...funcs: Array<(...args: Array<any>) => any>) {
if (funcs.length === 0) {
return (arg: any) => arg;
}
if (funcs.length === 1) {
return funcs[0];
}
const last = funcs[funcs.length - 1];
@viztastic
viztastic / Renaming Tabs in iTerm2
Last active June 19, 2016 09:25
For a while I've been trying to figure out how to label my tabs in iTerm2. Simply type in zsh at the prompt, followed by ENTER, then enter in echo -ne "\e]1;LABEL\a" where 'LABEL' is your desired tab name. And bob's your uncle.
$ zsh
$ echo -ne "\e]1;ENTER TAB NAME HERE\a"
$ exit
@shreyaskarnik
shreyaskarnik / Instructions.md
Last active March 24, 2023 15:35
Route Docker Logs to ELK Stack
  • With Docker 1.8.0 shipped new log-driver for GELF via UDP, this means that the logs from Docker Container(s) can be shipped directly to the ELK stack for further analysis.
  • This tutorial will illustrate how to use the GELF log-driver with Docker engine.
  • Step 1: Setup ELK Stack:
    • docker run -d --name es elasticsearch
    • docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
    • Note the config for Logstash can be found at this link
    • docker run --link es:elasticsearch -d kibana
  • Once the ELK stack is up now let's fire up our nginx container which ships its logs to ELK stack.
  • LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
  • `docker run -d --net=host --log-driver=gelf --log-opt gelf-address=u
@ThadeuLuz
ThadeuLuz / mdStyleColor.js
Last active March 17, 2016 05:13
Trying to add more flexibility to elements css in angular-material
(function () {
"use strict";
var _theme;
angular
.module('mdColors',['mdColors'])
.config(['$mdThemingProvider', function($mdThemingProvider){
_theme = $mdThemingProvider.theme();
@andystanton
andystanton / Start up local Docker Machine on OSX automatically.md
Last active April 3, 2024 00:50
Start up local Docker Machine on OSX automatically.

Notice

This script is no longer required with Docker for Mac which includes an option to run Docker at startup and doesn't use docker-machine to administer the local Docker engine.

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine called "default" docker-machine create --driver virtualbox default (this is the default with Docker toolkit).
@woloski
woloski / top.md
Created May 16, 2015 23:18
top 100 packages from heroku distiled for webtask
  • bcrypt: A bcrypt library for NodeJS.
  • pg: PostgreSQL client - pure javascript & libpq with the same API
  • q: A library for promises (CommonJS/Promises/A,B,D)
  • node-uuid: Rigorous implementation of RFC4122 (v1 and v4) UUIDs.
  • optimist: Light-weight option parsing with an argv hash. No optstrings attached.
  • aws-sdk: AWS SDK for JavaScript
  • validator: String validation and sanitization
  • cheerio: Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • knox: Amazon S3 client
  • consolidate: Template engine consolidation library
@bennadel
bennadel / ng-repeat-item.htm
Created February 18, 2015 13:22
Animating A Single Item Using ngRepeat And ngAnimate In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Animating A Single Item Using ngRepeat And ngAnimate In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@woloski
woloski / multitenant.md
Last active February 11, 2024 23:14
Multi Tenant Apps in Auth0

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client-organizations (tenants)

Let's start by enumerating some multi tenant applications and understand how they handle it.

Slack

Authentication:

@alancasagrande
alancasagrande / mongo_drop_multitenant_dbs.js
Created September 4, 2014 18:17
Small script to run with mongo to delete the multi-tenant databases
var dbs = db.getMongo().getDBNames();
for (var i in dbs) {
db = db.getMongo().getDB( dbs[i] );
if (db.getName().indexOf('multitenant') > -1) {
print('dropping db ' + db.getName());
db.dropDatabase();
}
}