Skip to content

Instantly share code, notes, and snippets.

View amimaro's full-sized avatar

Amir Zahalan amimaro

View GitHub Profile
@amimaro
amimaro / tecno-brega-stack-setup.sql
Last active April 26, 2022 23:16
Remix tecno-brega-stack setup
-- Create a table for Public Profiles
create table profiles (
id uuid references auth.users not null,
updated_at timestamp with time zone,
username text unique,
avatar_url text,
website text,
primary key (id),
unique(username),
@amimaro
amimaro / #_npx_commands.md
Last active July 11, 2022 17:20
NPX useful commands list

NPX Commands List

http-server

npx http-server [path] [options]

create-react-app

npx create-react-app@latest <project-name>

@amimaro
amimaro / git-reset-author.sh
Created May 17, 2021 10:54 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@amimaro
amimaro / #_nginx.conf
Last active May 11, 2021 23:42
NGINX configuration to deploy (Angular application) on docker
events {}
http {
# Browser preferred language detection (does NOT require AcceptLanguageModule)
map $http_accept_language $accept_language {
~*^pt pt;
~*^en en;
}
@amimaro
amimaro / _beep
Last active August 29, 2020 23:44
Script to beep and/or notify after command finish at terminal
#!/bin/bash
# Save this script at ~/Scripts
# Add to the script folder to PATH at ~/.bashrc (export PATH="~/Scripts:$PATH")
# Don't forget to make this script executable, use: chmod +x _beep
# Install sox: apt install sox
# Use any audio file
# -q -V1 to use silent mode
@amimaro
amimaro / Array2MatrixIndex.js
Last active March 22, 2018 13:57
Convert Array Index into Matrix Index
let matrix = Array.from(Array(100).keys());
let rows = 10, columns = 10;
let getRow = (index, totalRows) => {
return Math.floor(index/totalRows);
}
let getColumn = (index, totalColumns) => {
return index % totalColumns;
}
@amimaro
amimaro / UnityHttpListener.cs
Last active August 9, 2024 11:41
Listen for Http Requests with Unity
using UnityEngine;
using UnityEngine.Networking;
using System;
using System.IO;
using System.Net;
using System.Threading;
public class UnityHttpListener : MonoBehaviour
{
@amimaro
amimaro / UnityReadWriteFile.cs
Last active March 19, 2018 12:33
Read and Write files with Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Text;
using System.IO;
public class UnityReadWriteFile : MonoBehaviour
{
void Start ()
@amimaro
amimaro / UnityHttpRequest.cs
Last active February 5, 2020 08:50
Unity Http Request Example
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class UnityRequest : MonoBehaviour
{
bool display = false;
private GUIStyle guiStyle = new GUIStyle ();
public string uri = "http://localhost:8080";
@amimaro
amimaro / UnityDelay.cs
Created March 16, 2018 14:19
Unity Delay Function
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DelayTest : MonoBehaviour
{
bool display = false;
void Start ()