Skip to content

Instantly share code, notes, and snippets.

View sublimino's full-sized avatar
:shipit:
Investigating the Unexplainable

Andrew Martin sublimino

:shipit:
Investigating the Unexplainable
View GitHub Profile
@laggingreflex
laggingreflex / sort.js
Created November 16, 2016 14:17
Sort github comments by reactions
(() => {
const q = (e, s) => e.querySelector(s);
const qA = (e, s) => e.querySelectorAll(s);
const num = e => parseInt(e.nextSibling.wholeText.trim())
const d = document.querySelector('.js-discussion.js-socket-channel');
/* uncomment one of these to sort by */
const sortBy = '+1';
// const sortBy = '-1';
// const sortBy = 'smile';
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 21, 2024 02:11
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@quilime
quilime / tsws
Last active January 15, 2022 07:31 — forked from dfletcher/tsws
Totally simple web server using Bash and netcat (nc)
#!/bin/bash
# --------------------------------
# Totally Simple Web Server (TSWS)
# --------------------------------
#
# (c) 2015 Dave Fletcher
# All Rights Reserved
#
# This is free and unencumbered software released into the public domain.
@Nervengift
Nervengift / i3_focus_next
Last active January 20, 2023 19:05
focus next window in i3 (like Alt+Tab in other WMs)
#!/bin/bash
# ================================================================================== #
# Focus the next window on the current workspace in i3, e.g. for binding to Alt+Tab #
# Depends: jq, awk, i3wm (obviously) #
# Author: Nervengift <dev@nerven.gift> #
# License: Don't think this deserves a license, Public Domain #
# Known bugs: doesn't work with non-window container focused #
# ================================================================================== #
ws=$(i3-msg -t get_workspaces|jq "map(select(.focused))[]|.name")
@jimmycuadra
jimmycuadra / cloud-config.yml
Last active April 19, 2021 03:04
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<token>
# multi-region deployments, multi-cloud deployments, and droplets without
# private networking need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
Instructions for trying ext4+overlay with docker! In an up-to-date SDK:
Write the following to /build/amd64-usr/etc/portage/package.keywords/overlay
sys-kernel/coreos-sources
sys-kernel/coreos-kernel
sys-fs/btrfs-progs
app-emulation/docker
In src/scripts make the following change to switch to ext4:
@demisx
demisx / gulpfile.js
Last active July 14, 2022 16:06
Gulp 4 gulpfile.js
// Gulp 4
var gulp = require('gulp');
var using = require('gulp-using');
var grep = require('gulp-grep');
var changed = require('gulp-changed');
var del = require('del');
var coffee = require('gulp-coffee');
var less = require('gulp-less');
var coffeelint = require('gulp-coffeelint');
var sourcemaps = require('gulp-sourcemaps');
@richp10
richp10 / gist:1c367d3c67aec762788e
Created May 10, 2014 10:19
Secure iptables configuration for coreos ??
// This systemd runs iptables-restore on boot:
[Unit]
Description=Packet Filtering Framework
DefaultDependencies=no
After=systemd-sysctl.service
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/iptables-restore /opt/docker/scripts/iptables/iptables.rules
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet