Skip to content

Instantly share code, notes, and snippets.

View sebastiandg7's full-sized avatar
🌊

Sebastian Duque Gutierrez sebastiandg7

🌊
View GitHub Profile
@sebastiandg7
sebastiandg7 / ei.cfg
Last active April 12, 2024 00:55
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
[EditionID]
Professional
[Channel]
Retail
@sebastiandg7
sebastiandg7 / emulator-install-using-avdmanager.md
Created November 12, 2019 17:09 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

About

  • 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
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, ...rest } = props;
return reset ? <div {...rest}> </div> : <div {...rest} />;
#!/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
sebastiandg7 / RAR_all_directories.sh
Created April 9, 2020 14:08
Compress all folders in current directory in their own RAR file
for folder in */
do
rar a -m5 -r "${folder%/}.rar" "$folder"
done
@sebastiandg7
sebastiandg7 / nativescript-android-setup.sh
Last active February 27, 2020 17:17
NativeScript Ubuntu 19.10 - Android Setup
#!/bin/bash
# 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 https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O /tmp/sdk-tools.zip
sudo mkdir -p /usr/local/android/sdk && sudo chown -R $USER:$USER /usr/local/android/sdk
cd /tmp && unzip sdk-tools.zip && rm -f sdk-tools.zip && 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
sebastiandg7 / S3-Static-Sites.md
Created August 20, 2019 17:00 — forked from bradwestfall/S3-Static-Sites.md
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 www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@sebastiandg7
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: http://git.mikaelb.net/presentations/bartjs/destructuring
// === 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
sebastiandg7 / npm
Last active January 15, 2019 23:58
npm script fix for Windows shared node installation with WSL
#!/bin/sh
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if grep -iq 'Microsoft\|WSL' /proc/version; then
@sebastiandg7
sebastiandg7 / insert_all_timezones.sql
Last active October 16, 2018 17:50
Insert all timezones to database (name and UTC offset).
USE `database`;
CREATE TABLE `timezone` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`offset` VARCHAR(10) NOT NULL,
`raw_offset` INT NOT NULL,
PRIMARY KEY (`id`)
)