Skip to content

Instantly share code, notes, and snippets.

View sebastiandg7's full-sized avatar

Sebastian Duque Gutierrez sebastiandg7

View GitHub Profile
sebastiandg7 / jsx-generics-component.tsx
Created March 3, 2022 15:00
JSX Component with generics
import React from 'react';
export interface FadeInViewProps {
reset?: boolean;
function FadeInView<T>(props: FadeInViewProps & T) {
const { reset, } = props;
return reset ? <div {}> </div> : <div {} />;
#!/usr/bin/env sh
set -- $(locale LC_MESSAGES)
yesptrn="$1"; noptrn="$2"; yesword="$3"; noword="$4"
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
input_sink=$(pacmd stat |grep -o -P "(?<=Default source name: ).*")
output_sink=$(pacmd stat |grep -o -P "(?<=Default sink name: ).*")
echo "Input:" $input_sink
sebastiandg7 /
Created April 9, 2020 14:08
Compress all folders in current directory in their own RAR file
for folder in */
rar a -m5 -r "${folder%/}.rar" "$folder"
sebastiandg7 /
Last active February 27, 2020 17:17
NativeScript Ubuntu 19.10 - Android Setup
# NativeScript Ubuntu 19.10 - Android Setup
sudo apt install -y lib32z1 lib32ncurses6 libbz2-1.0:i386 libstdc++6:i386 g++ openjdk-8-jdk unzip
wget -O /tmp/
sudo mkdir -p /usr/local/android/sdk && sudo chown -R $USER:$USER /usr/local/android/sdk
cd /tmp && unzip && rm -f && mv tools /usr/local/android/sdk
export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
export ANDROID_HOME="/usr/local/android/sdk/"
sebastiandg7 /
Created November 12, 2019 17:09 — forked from mrk-han/
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER


  • The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    • These can be run locally or on the base build agent.
  • Note: X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.
  • We create two sets of emulators here, one set with pixel hardware emulation and one set with default oem emulation.

See: Google Documentation on Start the emulator from the command line for more info

sebastiandg7 /
Created August 20, 2019 17:00 — forked from bradwestfall/
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect to
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation


sebastiandg7 / destructuring.js
Created February 10, 2019 01:45 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic:
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
sebastiandg7 / ei.cfg
Last active June 9, 2024 13:55
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
sebastiandg7 / npm
Last active January 15, 2019 23:58
npm script fix for Windows shared node installation with WSL
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
if grep -iq 'Microsoft\|WSL' /proc/version; then
sebastiandg7 / delete_duplicates.bash
Created August 30, 2018 17:46
Delete duplicated files in linux
declare -A arr
shopt -s globstar
for file in **; do
[[ -f "$file" ]] || continue
read cksm _ < <(md5sum "$file")
if ((arr[$cksm]++)); then
echo "rm $file"