Skip to content

Instantly share code, notes, and snippets.

View tuucan's full-sized avatar

Tuğcan Karabörk tuucan

View GitHub Profile
const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
return;
}
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
@cmawhorter
cmawhorter / proxy.js
Created June 26, 2014 05:36
Node script to forward all http requests to another server and return the response with an access-control-allow-origin header. Follows redirects.
// Simple proxy/forwarding server for when you don't want to have to add CORS during development.
// Usage: node proxy.js
// Open browser and navigate to http://localhost:9100/[url]
// Example: http://localhost:9100/http://www.google.com
// This is *NOT* for anything outside local development. It has zero error handling among other glaring problems.
// This started as code I grabbed from this SO question: http://stackoverflow.com/a/13472952/670023
@gbero
gbero / fish_shell_android_home.txt
Last active March 7, 2024 19:05
Export $ANDROID_HOME on MacOS with Fish shell
touch ~/.config/fish/config.fish;
echo "set --export ANDROID $HOME/Library/Android;" >> ~/.config/fish/config.fish
echo "set --export ANDROID_HOME $ANDROID/sdk;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/tools $PATH;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/tools/bin $PATH;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/platform-tools $PATH;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/emulator $PATH" >> ~/.config/fish/config.fish
echo "set --export JAVA_HOME /Applications/Android\ Studio.app/Contents/jbr/Contents/Home;" >> ~/.config/fish/config.fish
@scokmen
scokmen / HttpStatusCode.ts
Created April 25, 2017 11:10
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body