Skip to content

Instantly share code, notes, and snippets.

View thompsonemerson's full-sized avatar
:octocat:

Emerson Thompson thompsonemerson

:octocat:
View GitHub Profile
@thompsonemerson
thompsonemerson / settings.json
Created February 4, 2025 20:52
VS Code | Compact Settings
{
"windown.zoomLevel": 1,
"window.commandCenter": false,
"workbench.colorTheme": "Min Dark",
"workbench.iconTheme": "symbols",
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.labelFormat": "short",
"workbench.activityBar.location": "top",
"workbench.statusBar.visible": false,
const pretty = {
log: (label, value, type = '') => {
console.log('%c⚡ ' + label, 'background-color: #9b59b6; border-left: 5px solid #8e44ad; padding: 2px 8px');
switch (type) {
case 'warn':
console.warn(value);
break;
case 'table':
:root {
--font-family: 'Fira code', sans-serif;
--color-background: #282a36;
--color-foreground: #f8f8f2;
--color-cyan: #8be9fd;
--color-green: #50fa7b;
--color-orange: #ffb86c;
--color-pink: #ff79c6;
--color-purple: #bd93f9;
--color-red: #ff5555;
@thompsonemerson
thompsonemerson / .bash_profile
Created December 15, 2017 18:24
custom terminal
# Custom Terminal
getGit() {
local s='';
local branchName='';
# Check if the current directory is in a Git repository.
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
# check if the current directory is in .git before running git checks
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
@thompsonemerson
thompsonemerson / learning-rxjs.js
Last active September 7, 2017 14:45
Learning the RxJS - Excerpted from the talk by André Staltz (https://youtu.be/uQ1zhJHclvs)
function map(transformFn) {
const inputObservable = this
const outputObservable = createObervable((outputObservable) => {
inputObservable.subscribe({
next: (x) => {
const y = transformFn(x)
outputObservable.next(y)
},
error: (err) => outputObservable.error(err),
complete: () => outputObservable.complete()
@thompsonemerson
thompsonemerson / methods.socket.js
Created January 6, 2017 12:37
Some methods to use with socket.io
// Send only to the current client
client.emit('message', "this is a test");
// Send to all customers, including the current
io.emit('message', "this is a test");
// Send to all clients except current
client.broadcast.emit('message', "this is a test");
// Send to all clients (exception current) for a specific room
@thompsonemerson
thompsonemerson / wp-config.php
Last active September 27, 2016 12:34
Rewrite URL - WordPress
/**
* Rewrite URL
*
* Change this parameter to url of your website
*/
define('WP_HOME','http://localhost:3000/');
define('WP_SITEURL','http://localhost:3000/');