Skip to content

Instantly share code, notes, and snippets.

View CodeMan99's full-sized avatar

Cody A. Taylor CodeMan99

View GitHub Profile
/*
* Home directory: /var/lib/jenkins/
* Example Job Workspace: /var/lib/jenkins/.jenkins/workspace/Sterling-make-build/
*/
def command = """
apt-cache showpkg python3-pip
""";
def proc = command.execute();
proc.waitFor();
#!/bin/sh
git ls-files "*.mak" | sed 'p; s/mak$/mako/' | xargs -n2 git mv;
bad=$(git grep -l '\.mak\b')
echo $bad | xargs -n1 sed -i 's/\.mak\b/.mako/'
git add $bad
git commit -m "Change '.mak' extension to '.mako'."
var http = require('http');
function http_collect(url, callback) {
http.get(url, function(resp) {
var data = [];
resp.setEncoding('utf8');
resp.on('data', Array.prototype.push.bind(data));
resp.on('end', function() {
return callback(null, data.join(''));
});
Python 3.4.3+ (3.4:dc10c52c6539, Apr 9 2015, 23:04:55)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> """Hello
... There
...
... I have some blank lines
...
... as well as a trailing newline.
... """.split("\n")
⌘ – ⌘ – ⌘ – the Command Key symbol
⌥ – ⌥ – ⌥ – the Option Key symbol
⇧ – ⇧ – ⇧ – the Shift Key symbol
⎋ – ⎋ – ⎋ – the ESC Key symbol
⇪ – ⇪ – ⇪ – the Capslock symbol
⏎ – ⏎ – ⏎ – the Return symbol
⌫ – ⌫ – ⌫ – the Delete / Backspace symbol
function arrayFrom(a) {
return Array.from(arguments).slice(1);
}
function arraySlice(a) {
return Array.prototype.slice.call(arguments, 1);
}
function argsRest(a, ...args) {
return args;
@CodeMan99
CodeMan99 / README.md
Last active April 29, 2018 04:32
Setup your "development" folder for more meta information.

Development Tree

Replacing a flat tree with one that has meta information baked in.

Typical Approach

When cloning projects you likely have some sort of "development" directory. That is where most, if not all, resulting directories of git clone reside. You

{
const RUN = 50000;
const FLAT_LENGTH = 9;
const a = [
[0, 1, 2, 3],
4,
[5, 6, 7],
8
];
const perf = [];
@CodeMan99
CodeMan99 / slice_utils.py
Created May 7, 2021 15:00
Create left & right slices of a collection
from operator import itemgetter
def create_slicer(*indexes):
"""
>>> l = list(range(10))
>>> create_slicer(5)(l)
([0, 1, 2, 3, 4], [5, 6, 7, 8, 9])
>>> create_slicer(3, 7)(l)
([0, 1, 2], [3, 4, 5, 6], [7, 8, 9])
>>> create_slicer(3, 5, 7)(l)