Skip to content

Instantly share code, notes, and snippets.

View sugaith's full-sized avatar
🈁
action = 'to code'; theQuestion = action || ! action; expect(theQuestion).toBe..

Thiago da Silva sugaith

🈁
action = 'to code'; theQuestion = action || ! action; expect(theQuestion).toBe..
View GitHub Profile
@sergeyzenchenko
sergeyzenchenko / russia-ddos.md
Last active August 25, 2025 18:55
Russia DDOS list
@aquiseb
aquiseb / commit-msg.md
Last active January 30, 2024 08:45
Husky Node.js - Git commit prepend issue tag to commit message

Automatically prepend issue tag to commit message

From the following tutorial

Consistency is a very important factor in software development.

But because different developers have different experiences and preferences it takes some time and effort to achieve consistency in projects.

A solution to that are discussed and then tool-enforced rules. Some solutions to that are linters, code formatters, checks on the CI and code reviews.

@LucasCalazans
LucasCalazans / usememo-example.js
Last active April 22, 2022 20:22
useMemo example
const categories = useMemo(() => {
return products.reduce((categories, { category }) => {
return !category || categories.find(({ id }) => category && category.id === id)
? categories
: [
...categories,
{
id: category.id,
value: category.id,
label: category.title,
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active December 13, 2025 13:22
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@jjvillavicencio
jjvillavicencio / setup.sh
Last active December 3, 2025 05:16
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@gaearon
gaearon / index.html
Last active October 21, 2025 03:08
Multiple React components on a single HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@IsmailShurrab
IsmailShurrab / firebase notification curl
Created December 10, 2017 12:35
firebase notification curl php
<?php
$url = "https://fcm.googleapis.com/fcm/send";
$token = "your device token";
$serverKey = 'your server token of FCM project';
$title = "Notification title";
$body = "Hello I am from Your php server";
$notification = array('title' =>$title , 'text' => $body, 'sound' => 'default', 'badge' => '1');
$arrayToSend = array('to' => $token, 'notification' => $notification,'priority'=>'high');
$json = json_encode($arrayToSend);
$headers = array();
@wschenk
wschenk / login.js
Created November 30, 2017 22:55
material-ui example login form
import React, {Component} from 'react';
import Button from 'material-ui/Button';
import TextField from 'material-ui/TextField';
import Dialog, {
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
withMobileDialog
} from 'material-ui/Dialog';
@marcogbarcellos
marcogbarcellos / BinarySearchTree.js
Last active February 14, 2021 19:55
Creating, manipulating and calculating distance between nodes inside a Binary Search Tree
function Node(value){
this.value = value;
this.left = null;
this.right = null;
}
function BinarySearchTree() {
this.root = null;
}
BinarySearchTree.prototype.push = function (val) {
@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app