Skip to content

Instantly share code, notes, and snippets.

@mael
mael / tricks.md
Last active May 1, 2024 21:45
Xcode 10.2 "Unable to boot the Simulator"

Solution "Unable to boot the Simulator"

sudo mkdir /private/tmp

sudo chmod 1777 /private/tmp

Other basic command

xcrun

xcrun simctl list devices //to list all simulators

xcrun simctl delete // to delete specific device

@jclosure
jclosure / play_spotify_via_winamp.md
Last active May 1, 2024 21:43
How to play your Spotify music in Winamp and get Visualizatons

Spotiamp features a builtin Shoutcast® server, so you can easily stream the music to any device supporting Shoutcast, such as Sonos.

Download and install Winamp

I've installed version 5.8

https://www.winamp.com/

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@igorjs
igorjs / rest-api-response-format.md
Last active May 1, 2024 21:40
REST API response format based on some of the best practices
@dhh
dhh / linux-setup.sh
Last active May 1, 2024 21:38
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@jparishy
jparishy / doc.md
Last active May 1, 2024 21:35
Snapchat Example API Doc

Snapchat API

Base URL

https://snapchat-example-api.herokuapp.com/api/v1/

Notes

  • All endpoints accept JSON payloads for parameters
    • Must include "Content-Type" HTTP header with value "application/json"
    • All endpoints accept /users/authenticate require the X-Api-Token HTTP header
@bradp
bradp / setup.sh
Last active May 1, 2024 21:34
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@brayevalerien
brayevalerien / monokai.md
Last active May 1, 2024 21:30
Monokai theme color codes

Monokai theme color codes

Intro

This document lists the colors used in the Monokai Pro theme with the Classic filter. Please check the Monokai Pro website for more informations.

Colors

Monokai Pro with Classic filter colors:

Preview Hexadecimal RGB
Activity Bar Background activity bar background preview #272822 (39, 40, 34)
Activity Bar Foreground activity bar foreground preview #f8f8f2 (248, 248, 242)
@kerard
kerard / test-dc-ports.ps1
Created March 28, 2022 17:29
domain controller ports test
$ports = "135","389","636","3268","53","88","445","3269"
$dcs = Get-ADDomainController -Filter *
ForEach($dc in $dcs)
{
Foreach ($p in $ports)
{
$_test = Test-NetConnection $dc.Hostname -Port $p -WarningAction SilentlyContinue
If ($_test.tcpTestSucceeded -eq $true)
@drmalex07
drmalex07 / convertUuidToBigInteger.java
Last active May 1, 2024 21:29
Convert a UUID to an unsigned BigInteger #java #UUID #BigInteger
public static final BigInteger B = BigInteger.ONE.shiftLeft(64); // 2^64
public static final BigInteger L = BigInteger.valueOf(Long.MAX_VALUE);
public static BigInteger convertToBigInteger(UUID id)
{
BigInteger lo = BigInteger.valueOf(id.getLeastSignificantBits());
BigInteger hi = BigInteger.valueOf(id.getMostSignificantBits());
// If any of lo/hi parts is negative interpret as unsigned