Skip to content

Instantly share code, notes, and snippets.

View ismatim's full-sized avatar
:octocat:
in the world of words

Ismael J. Tisminetzky ismatim

:octocat:
in the world of words
View GitHub Profile
@ismatim
ismatim / rust.md
Created June 26, 2023 18:22 — forked from fabiotatsuo/rust.md
Install Rust, Cargo and Rustup Toolchain inside FreeBSD 12 Jail
  1. Install rust

    jail-app is name of jail.

    $ jexec jail-app
    $ pkg install curl
    

    Download and install rustup
    $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

@ismatim
ismatim / vmm-alpine.sh
Created February 2, 2021 03:39 — forked from voutilad/vmm-alpine.sh
Installing Alpine Linux in OpenBSD's VMM Hypervisor
# Assuming you're a regular user that has doas allowances for vmctl
mkdir -p ~/vmm
cd ~/vmm
# Grab the the one of the virt iso's of Alpine Linux
curl https://nl.alpinelinux.org/alpine/v3.6/releases/x86_64/alpine-virt-3.6.0-x86_64.iso -o alpine-virt-3.6.0-x86_64.iso
# Make a new virtual disk image, change the size as needed
vmctl create alpine-virt.img -s 6G
@ismatim
ismatim / access_postgresql_with_docker.md
Created December 18, 2020 14:02 — forked from MauricioMoraes/access_postgresql_with_docker.md
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@ismatim
ismatim / install-python-alpine.sh
Created December 12, 2020 00:37
Install Python 3.x.x in Ubuntu and Alpine
#!/bin/bash
if [ -z "$VERSION" ]; then
echo 'Please specify a version. e.g, "VERSION=3.8.5 sh install-python-alpine.sh"'
exit
fi
export PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
sudo apk update
@ismatim
ismatim / log4j.properties
Created October 27, 2020 17:04 — forked from xkr47/log4j.properties
log4j configuration with different colors for different log levels - also works with Eclipse Ansi Console: http://mihai-nita.net/2013/06/03/eclipse-plugin-ansi-in-console/
log4j.debug=false
# Default level is INFO
log4j.rootLogger=INFO,StdoutErrorFatal,StdoutWarn,StdoutInfo,StdoutDebug,StdoutTrace
# and for com.some.package.* log everything
log4j.logger.com.some.package=TRACE
log4j.appender.StdoutErrorFatal=org.apache.log4j.ConsoleAppender
log4j.appender.StdoutErrorFatal.layout=org.apache.log4j.PatternLayout
@ismatim
ismatim / gist:11056803d079bdbb41de9c098e8ea01f
Last active September 20, 2020 02:41
vm-bhyve openbsd steps
#remember to edit the .template/openbsd.conf to set the correct version.
pkg install vm-bhyve
zfs create pool/vm
echo 'vm_enable="YES"' >> /etc/rc.conf
echo 'vm_dir="zfs:pool/vm"' >> /etc/rc.conf
vm init
cp /usr/local/share/examples/vm-bhyve/* /mountpoint/for/pool/vm/.templates/
vm switch create public
vm switch add public em0
@ismatim
ismatim / regexres.md
Created May 10, 2020 22:41 — forked from ehaughee/regexres.md
Regular Expression Resources
@ismatim
ismatim / ffmpegToWeb.js
Created February 17, 2020 11:30 — forked from moeiscool/ffmpegToWeb.js
FFMPEG to Web Browser with Express, Socket.IO and JSMPEG
// Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test
// How to Use raw H.264 (Simulated RTSP)
// 1. Start with `node ffmpegToWeb.js`
// 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1
// 3. Open VLC and "Open Network Stream".
// 4. Input the following without quotes : `http://127.0.0.1:8001/h264` and start.
var child = require('child_process');
var io = require('socket.io');
var events = require('events');
@ismatim
ismatim / next.config.js
Created October 4, 2019 02:08 — forked from pkellner/next.config.js
Sample next.config.js for Next.js that includes environment variables, and other plugins (CSS and Image)
const withCSS = require("@zeit/next-css");
require('dotenv').config()
const path = require('path')
const Dotenv = require('dotenv-webpack')
const withImages = require('next-images')
module.exports = withCSS(withImages({
inlineImageLimit: 16384,
webpack(config, options) {

Redux higher order components

Sometimes we need to share props and behaviour between multiple components/containers. For that we can do a higher order component. Example:

Decorator component

Higher Order Component that will decorate other component: