REST API response format based on some of the best practices
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
https://snapchat-example-api.herokuapp.com/api/v1/
- All endpoints accept JSON payloads for parameters
- Must include "Content-Type" HTTP header with value "application/json"
- All endpoints accept
/users/authenticate
require theX-Api-Token
HTTP header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This document lists the colors used in the Monokai Pro theme with the Classic filter. Please check the Monokai Pro website for more informations.
Monokai Pro with Classic filter colors:
Preview | Hexadecimal | RGB | |
---|---|---|---|
Activity Bar Background | #272822 |
(39, 40, 34) | |
Activity Bar Foreground | #f8f8f2 |
(248, 248, 242) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On the shared machine: | |
Download http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.33.0.jar&can=2&q= | |
$ brew install chromedriver | |
$ java -jar selenium-server-standalone-2.33.0.jar | |
On the local machine: | |
Set `CHROME_HOSTNAME` in your `.env`, `.rbenv_vars`, or per run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rotation matrix function | |
def rotate_matrix (x, y, angle, x_shift=0, y_shift=0, units="DEGREES"): | |
""" | |
Rotates a point in the xy-plane counterclockwise through an angle about the origin | |
https://en.wikipedia.org/wiki/Rotation_matrix | |
:param x: x coordinate | |
:param y: y coordinate | |
:param x_shift: x-axis shift from origin (0, 0) | |
:param y_shift: y-axis shift from origin (0, 0) | |
:param angle: The rotation angle in degrees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Lyle Scott, III // lyle@ls3.io | |
Multiple ways to rotate a 2D point around the origin / a point. | |
Timer benchmark results @ https://gist.github.com/LyleScott/d17e9d314fbe6fc29767d8c5c029c362 | |
""" | |
from __future__ import print_function | |
import math |
NewerOlder