Skip to content

Instantly share code, notes, and snippets.

Steel Brain steelbrain

Block or report user

Report or block steelbrain

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steelbrain
steelbrain / index.js
Created Aug 24, 2018
iTerm2 Color Profile Printer
View index.js
// Usage: node index.js
// Requires: npm install rgb-hex xml2json
// Requires color profile to be placed as Profile.itermcolors
// in same directory
const fs = require('fs')
const path = require('path')
const rgbHex = require('rgb-hex')
const { toJson } = require('xml2json')
View index.js
const os = require('os')
const cluster = require('cluster')
if (cluster.isMaster) {
const spawned = os.cpus().map(() => cluster.fork())
spawned.forEach(spawnedItem => {
spawnedItem.send({ cmd: 'ping' })
spawnedItem.on('message', function(msg) {
console.log('message from spawned', msg)
})
View keybase.md

Keybase proof

I hereby claim:

  • I am steelbrain on github.
  • I am steelbrain (https://keybase.io/steelbrain) on keybase.
  • I have a public key ASB_pJAHQs77l5i1ik2H28jnN_lkp6ZDyzTXZ_OVbDieiwo

To claim this, I am signing this object:

@steelbrain
steelbrain / One-Dark.itermcolors
Last active Mar 13, 2019
One Dark Iterm scheme
View One-Dark.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
View gist:1a7d6ce815da488b12d70e2692cb3b39
Verifying my Blockstack ID is secured with the address 1LtREgjTmFWxmg7UKr2uqdM75RLAd51CAJ https://explorer.blockstack.org/address/1LtREgjTmFWxmg7UKr2uqdM75RLAd51CAJ
@steelbrain
steelbrain / music_metadata.js
Last active Dec 1, 2018
Song metadata filling with ffmpeg node script
View music_metadata.js
#!/usr/bin/env node
// Usage:
// $ cd dir/to/music
// $ node ../../music_metadata.js
// Files format must be:
// [Artist] - [Song Title].{oga,m4a}
const fs = require('fs')
const os = require('os')
@steelbrain
steelbrain / git-c
Last active Aug 23, 2017
Fancy git commit
View git-c
#!/bin/bash
# Author: Steel Brain <i@steelbrain.me>
# Name: Git Commit
# Steps:
# - Check if jq is installed or not (need it for parsing package.json)
# - Shows unstaged files
# - Shows staged files
# - Confirms the user they want to proceed
# - Execute the build step and check in any files it modifies
View git-post-pr.sh
#!/bin/bash
# Usage:
# git-post-pr
# Description:
# Deletes local branch (doesn't force so you won't lose local if not pushed remotely)
# Fetches remote so local remote branch is deleted
# Switches to master
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
View pundle bug patch.patch
diff --git a/node_modules/pundle/lib/resolver.js.orig b/node_modules/pundle/lib/resolver.js
index ac094a3..469749c 100644
--- a/node_modules/pundle/lib/resolver.js.orig
+++ b/node_modules/pundle/lib/resolver.js
@@ -235,7 +235,7 @@ var Resolver = (_dec = (0, _helpers.attachable)('resolver'), _dec2 = _path4.defa
break;
}
}
- return request;
+ return givenRequest;
View build-package.sh
#!/bin/sh
echo "Downloading latest Atom release..."
ATOM_CHANNEL="${ATOM_CHANNEL:=stable}"
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
curl -s -L "https://atom.io/download/mac?channel=${ATOM_CHANNEL}" \
-H 'Accept: application/octet-stream' \
-o "atom.zip"
mkdir atom
You can’t perform that action at this time.