Skip to content

Instantly share code, notes, and snippets.

View williamdes's full-sized avatar
🚀
Catching up on GitHub notifications

William Desportes williamdes

🚀
Catching up on GitHub notifications
View GitHub Profile
@joepie91
joepie91 / monolithic-vs-modular.md
Last active September 19, 2024 04:07
Monolithic vs. modular - what's the difference?

When you're developing in Node.js, you're likely to run into these terms - "monolithic" and "modular". They're usually used to describe the different types of frameworks and libraries; not just HTTP frameworks, but modules in general.

At a glance

  • Monolithic: "Batteries-included" and typically tightly coupled, it tries to include all the stuff that's needed for common usecases. An example of a monolithic web framework would be Sails.js.
  • Modular: "Minimal" and loosely coupled. Only includes the bare minimum of functionality and structure, and the rest is a plugin. Fundamentally, it generally only has a single 'responsibility'. An example of a modular web framework would be Express.

Coupled?

In software development, the terms "tightly coupled" and "loosely coupled" are used to indicate how much components rely on each other; or more specifically, how many assumptions they make about each other. This directly translates to how easy it is to repla

@RicardoBelchior
RicardoBelchior / svg-to-android.sh
Last active December 8, 2017 21:32 — forked from deepankarb/svg-to-android.sh
A script to generate android assets from a SVG file. Requires inkscape to resize and convert.
#!/bin/bash
USAGE="Usage is: ./svg-to-android.sh <svg_file> <exported_png_name> <width_dp> <height_dp> [resources_dir] \n \
If 'resources_dir' is ommited, a new folder is created in the current directory, named after the svg name.\n \
Param 'exported_png_name' does not need extension.\n \
On Mac OS specify full path for svg file and resources directory.\n \
Exiting."
if [[ -z "$1" ]];
then
@ygotthilf
ygotthilf / jwtRS256.sh
Last active June 2, 2025 06:57
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@CMCDragonkai
CMCDragonkai / socat_server.sh
Last active August 6, 2021 22:03
Socat Simple HTTP Server #cli #network
socat \
-v -d -d \
TCP-LISTEN:1234,crlf,reuseaddr,fork \
SYSTEM:"
echo HTTP/1.1 200 OK;
echo Content-Type\: text/plain;
echo;
echo \"Server: \$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT\";
echo \"Client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\";
"
database:
pre:
- sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
- sudo apt-get update; sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server-5.6
- echo -e "[mysqld]\ninnodb_strict_mode = ON\ninnodb_file_format = Barracuda\ninnodb_large_prefix = 1" | sudo sh -c "cat >> /etc/mysql/my.cnf"
- sudo cat /etc/mysql/my.cnf
- sudo service mysql restart
- mysql -u ubuntu -e "SHOW GLOBAL VARIABLES LIKE 'innodb_%'"
- mysql -u ubuntu -e "SHOW DATABASES"
- mysql -u ubuntu -e "ALTER DATABASE circle_test CHARSET utf8mb4"
@james2doyle
james2doyle / phplint-folder.sh
Last active July 14, 2021 06:30
Use PHP lint on a folder of PHP files
#!/usr/bin/env bash
# found on http://kamisama.me/2012/07/02/faster-php-lint/
find my/folder/ -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
@ysasaki
ysasaki / cloudwatch-php-fpm-status.sh
Last active February 17, 2025 15:25
php-fpm status to AWS CloudWatch
#!/bin/bash
AWS_DEFAULT_REGION="ap-northeast-1"
AWS_ACCESS_KEY_ID="YOUR ACCESS KEY HERE"
AWS_SECRET_ACCESS_KEY="YOUR SECRET ACCESS KEY HERE"
INSTANCE_ID_URL="http://169.254.169.254/latest/meta-data/instance-id"
INSTANCE_ID=$(curl -s ${INSTANCE_ID_URL})
SERVER_STATUS_URL="http://localhost/php-fpm-status"
@bmutinda
bmutinda / SwipeEvents.java
Last active May 2, 2023 22:38
Android swipe events detector
package bmutinda.com.androidutils.libs;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by Mutinda Boniface on 7/5/2015.
*/
public class SwipeEvents implements View.OnTouchListener {
private SwipeCallback swipeCallback;
@barroco
barroco / raven-shell
Last active May 4, 2024 11:25
Send Sentry error from shell using curl
#!/bin/sh
SENTRY_KEY=
SENTRY_SECRET=
SENTRY_PROJECTID=1
SENTRY_HOST=sentry.example.com
SCRIPT_ARGUMENTS=$@
capture_error()
{
@marvell
marvell / remove_apt_cache
Created May 18, 2015 15:29
Remove APT cache (for Dockerfile)
apt-get clean autoclean
apt-get autoremove --yes
rm -rf /var/lib/{apt,dpkg,cache,log}/