Skip to content

Instantly share code, notes, and snippets.

View alexandrusavin's full-sized avatar
🤞
Coding

Alexandru Savin alexandrusavin

🤞
Coding
View GitHub Profile
@alexandrusavin
alexandrusavin / ReactFnCompPropsChecker.tsx
Created December 23, 2020 17:27
ReactFnCompPropsChecker
import React from 'react';
// TYPES
interface PropsCheckerProps<T> {
children: (props: T) => React.ReactElement | null;
childrenProps: T;
compType?: ComparaisonTypes;
verbose?: boolean;
}
#!/bin/bash
SCRIPT=$(basename "$0")
exitWithError () {
echo -e "$1" 1>&2
exit 1
}
usage () {
@alexandrusavin
alexandrusavin / clissomget.sh
Last active May 6, 2020 12:13
CLI tool which enables you to login and retrieve AWS temporary credentials using clisso and 1Password
#!/bin/bash
SCRIPT=$(basename "$0")
exitWithError () {
echo -e "$1" 1>&2
exit 1
}
usage () {
#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@alexandrusavin
alexandrusavin / .zshrc
Last active January 30, 2022 13:58
My MacOS zsh config file
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export PATH=/Users/alexandrusavin/bin:$PATH
@alexandrusavin
alexandrusavin / binds_on_mount.sh
Last active February 4, 2024 14:48
Add letsencrypt certificate to dd-wrt web interface
#!/bin/sh
if [ `nvram get https_enable` -gt 0 ] ; then
# get the absolute directory of the executable
SELF_PATH=$(cd -P "$(dirname "$0")" && pwd -P)
echo SELF_PATH: ${SELF_PATH}
# extract the mount path
@alexandrusavin
alexandrusavin / 2bunyan.sh
Created March 31, 2016 17:40
Wrap node interpreter to be to pipe to bunyan in Intellij IDEs run configurations
#!/usr/bin/env bash
~/.nvm/nvm.sh use default
node $@ | ./node_modules/.bin/bunyan
@alexandrusavin
alexandrusavin / setup.js
Created September 30, 2015 17:36
root mocha setup for mongodb int tests
'use strict';
var mongoose = require('mongoose');
var _ = require('lodash');
var conn;
function clearDB() {
var cleaned = [];
input {
stdin {
type => "stdin-type"
}
udp {
port => "9999"
}
tcp {
port => "9998"
}
module.exports = {
testIfArray: function (arr) {
return !!arr && Array.isArray(arr);
},
testIfObject: function (obj) {
return !this.testIfArray(obj) && typeof obj === 'object';
},