Skip to content

Instantly share code, notes, and snippets.

@siraben
siraben / autocollect.sh
Last active Feb 9, 2021
macOS script to collect and dedup MAC addresses from a network
View autocollect.sh
#!/bin/bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2018 Ben Siraphob <bensiraphob@gmail.com>
command -v gshuf >/dev/null 2>&1 || { echo >&2 "gshuf is required but is not installed. Run \"brew install coreutils\"."; control_c; }
command -v spoof-mac >/dev/null 2>&1 || { echo >&2 "spoof-mac is required but is not installed. Run \"brew install spoof-mac\"."; control_c; }
# Colors
RED='\033[0;31m'
NC='\033[0m'
@bertoort
bertoort / standards_for_developers.md
Created Apr 30, 2020
What makes a senior software engineer?
View standards_for_developers.md

| Standard | Junior | Mid | Senior

@devonzuegel
devonzuegel / close-zoom-tab-on-success.js
Last active May 24, 2020
Close Zoom tab on success — TamperMonkey
View close-zoom-tab-on-success.js
/* This has moved to:
* https://github.com/devonzuegel/digital-nesting/blob/master/zoom.js
*/
@cmod
cmod / hugofastsearch.md
Last active Feb 25, 2021 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator
View hugofastsearch.md

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active Feb 12, 2021
Install mysql2 on MacOS Mojave
View mysql2-mojave.md

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@bcnzer
bcnzer / postman-pre-request.js
Last active Mar 9, 2021
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
View postman-pre-request.js
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@BryanSchuetz
BryanSchuetz / cachebust.rb
Created Feb 17, 2018
CSS Cache Bust Jekyll Plugin
View cachebust.rb
module Jekyll
module CacheBust
class CacheDigester
require 'digest/md5'
attr_accessor :file_name, :directory
def initialize(file_name:, directory: nil)
self.file_name = file_name
self.directory = directory
@levelsio
levelsio / btc-eth-dca-buy.php
Last active Mar 8, 2021
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
View btc-eth-dca-buy.php
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@NicholasJacques
NicholasJacques / rails_setup.markdown
Last active Mar 3, 2021
Getting Started with RSpec and Rails:
View rails_setup.markdown

Getting Started with RSpec and Rails:

Setting up a new Ruby on Rails project using RSpec, Cabybara, FactoryGirl and DatabaseCleaner

What will this tutorial do you for you?

This tutorial will help guide you through the process of setting up a new Ruby on Rails project with robust testing capabilities. This tutorial makes a couple of assumptions:

  • You have installed Ruby on Rails and have a rudimentary understanding of how to use it.
  • You have installed bundler
@kristopolous
kristopolous / hn_seach.js
Last active Mar 3, 2021
hn job query search
View hn_seach.js
function query() {
var
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments),
shown = 0, total = job_list.length;
// Traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.classList.contains(klass)) {