Skip to content

Instantly share code, notes, and snippets.

@smpb
smpb / OneDark.json
Created June 1, 2024 00:28
iSh shell Atom One Dark theme.
{
"appearance" : {
"darkOverride" : false,
"lightOverride" : true
},
"shared" : {
"backgroundColor" : "#282c34",
"colorPaletteOverrides" : [
"#282c34",
"#e06c75",
@smpb
smpb / AtomOneDark.js
Created May 31, 2024 01:32 — forked from zeiv/AtomOneDark.js
Blink shell Atom One Dark theme
black = '#282c34';
red = '#e06c75'; // red
green = '#98c379'; // green
yellow = '#d19a66'; // yellow
blue = '#56b6c2'; // blue
magenta = '#c678dd'; // pink
cyan = '#56b6c2'; // cyan
white = '#d0d0d0'; // light gray
lightBlack = '#808080'; // medium gray
lightRed = '#e06c75'; // red
@smpb
smpb / LC_COLORS.md
Created January 15, 2024 15:17 — forked from thomd/LC_COLORS.md
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@smpb
smpb / git-commit-author-rewrite.md
Created March 13, 2020 18:22 — forked from trey/git-commit-author-rewrite.md
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <email@address.com>"

or

$ git commit --amend --reset-author
@smpb
smpb / 1-sleep-es7.js
Created March 4, 2020 14:15 — forked from danharper/1-sleep-es7.js
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()
#!/usr/bin/env bash
# See <http://perltricks.com/article/57/2014/1/1/Shazam-Use-Image-Magick-with-Perlbrew-in-minutes>
# may need to have the perl configured with -Duseshrplib
#
# perl -V | grep -- '-Duseshrplib'
# compile perl with perlbrew:
#
@smpb
smpb / tinyfugue-osx.patch
Created January 2, 2013 12:05
"The TinyFugue website says that it should compile right out of the box with the OS X dev tools installed, but this doesn’t seem to work. While compiling it right out of the box, I get the following error after running make: malloc.c:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'malloc_base' So I took a look at line 15 of m…
--- src/malloc.orig.c 2009-10-29 03:16:07.000000000 -0500
+++ src/malloc.c 2009-10-29 03:16:18.000000000 -0500
@@ -12,7 +12,7 @@ static const char RCSid[] = "$Id: malloc
#include "signals.h"
#include "malloc.h"
-caddr_t mmalloc_base = NULL;
+void *mmalloc_base = NULL;
int low_memory_warning = 0;
static char *reserve = NULL;
@smpb
smpb / camel.pl
Created December 17, 2012 15:28
The camel code. Found it here: http://www.perlmonks.org/?node_id=45213
#!/usr/bin/perl -w # camel code
use strict;
$_='ev
al("seek\040D
ATA,0, 0;");foreach(1..3)
{<DATA>;}my @camel1hump;my$camel;
my$Camel ;while( <DATA>){$_=sprintf("%-6
9s",$_);my@dromedary 1=split(//);if(defined($
_=<DATA>)){@camel1hum p=split(//);}while(@dromeda
@smpb
smpb / change_git_authorship.sh
Created December 17, 2012 15:15
When juggling the setup of several git repositories it's easy to forget to configure the adequate e-mail address you want associated with your commits. Personally, I am guilty of regularly adding the address of my personal projects onto work commits, and vice-versa. Be aware that you are rewriting git history by using this.
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "the_dude@ibowl.com" ]
@smpb
smpb / long_polling.js
Created October 31, 2012 23:53
jQuery polling strategies
(function poll(){
$.ajax({
url: '/poll',
success: function(data) {
console.log(data);
},
error: function(msg) { console.log('bummer...') },
dataType: 'json',
complete: poll,
timeout: 30000