Skip to content

Instantly share code, notes, and snippets.

@mildred
mildred / download.sh
Created October 20, 2014 10:03
Download from archive.org Wayback Machine
#!/bin/bash
url=http://redefininggod.com
webarchive=https://web.archive.org
wget="wget -e robots=off -nv"
tab="$(printf '\t')"
additional_url=url.list
# Construct listing.txt from url.list
# The list of archived pages, including some wildcard url
@abn
abn / heredoc-dockerfile.snip
Last active October 5, 2023 17:43
Dockerfile alternatives for heredoc
#printf
RUN printf '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
>> /tmp/hello
#echo
RUN echo -e '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
@Aricg
Aricg / gist:56f1a769cbdcbb93b459
Last active June 12, 2023 09:43
Enable gerrit replication to github
Gerrit version 2.8
Replication plugin extracted from gerrit.war and installed over ssh
Installation method ->
a) Relevant configs:
/var/lib/gerrit/etc/replication.config
[remote "aricg-compliance"]
url = git@github.com:somerepo/${name}.git
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
@joshuajabbour
joshuajabbour / GitHub Wiki Subtree Storage.markdown
Created January 22, 2014 23:10
Store and edit GitHub wikis within the main project repository.

Project documentation

The project documentation (stored in the docs directory) is a git subtree of the project wiki. This allows for the documentation to be referenced and edited from within the main project.

Initial local setup

When cloning the main project repository for the first time, the wiki repository must be added as a remote.

git remote add wiki https://github.com//.wiki.git

@jeremyfelt
jeremyfelt / open-source-search-compare.md
Last active July 19, 2023 01:28
Comparing open source search solutions
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@vi
vi / 0001-contrib-subtree-Implement-graft-parent-option.patch
Created May 7, 2013 02:10
--graft-parent option for `subtree split` contrib script (based on v1.8.3-rc1)
From a0256e3220f90ab74d53680bff87067a8f544ec5 Mon Sep 17 00:00:00 2001
From: Vitaly _Vi Shukela <vi0oss@gmail.com>
Date: Tue, 7 May 2013 05:07:08 +0300
Subject: [PATCH] contrib/subtree: Implement --graft-parent option
---
contrib/subtree/git-subtree.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh