Skip to content

Instantly share code, notes, and snippets.

@badsyntax
badsyntax / multiple-gource.sh
Created April 8, 2022 08:19 — forked from PhiSYS/multiple-gource.sh
Create multiple repositories visualization video using gource and ffmpeg
#!/usr/bin/bash
declare -a repos=(
"$HOME/Projects/myproject/testing/.git"
"$HOME/Projects/myproject/testing-bundle/.git"
"$HOME/Projects/myproject/service-skeleton/.git"
"$HOME/Projects/myproject/documentation-web/.git"
"$HOME/Projects/myproject/documentation-api/.git"
"$HOME/Projects/myproject/coding-standard/.git"
"$HOME/Projects/myproject/context/microservice1/.git"
@badsyntax
badsyntax / s3etag.sh
Last active December 16, 2021 13:47 — forked from emersonf/s3etag.sh
Generate an S3 ETAG for a multipart upload file, on MacOS
#!/bin/bash
# Generate an S3 ETAG for a multipart upload file.
#
# From: https://gist.github.com/emersonf/7413337
# Author: Emerson Farrugia <https://github.com/emersonf>
# Modified by: Richard Willis <https://github.com/badsyntax>
# Modifications: Work with bytes instead of MB.
#
# MacOS only!
@badsyntax
badsyntax / React Native Clear Cache
Created February 5, 2021 18:11 — forked from jarretmoses/React Native Clear Cache
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
1. Create a new directory;
mkdir Apple\ Enterprise
cd Apple\ Enterprise
2. Generate a certificate signing request
openssl req -nodes -newkey rsa:2048 -keyout ios_enterprise.key -out CertificateSigningRequest.certSigningRequest
3. With the information like so (ensure you give it a password):
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:London
@badsyntax
badsyntax / index.md
Created September 1, 2014 08:38 — forked from mathisonian/index.md

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

inspiration

My inspiration for building this was Max Ogden's Requirebin, which allows users to use a browser based editor to run custom javascript in the browser (including javascript that had require() statements that would normally need to be pre-processed using browserify).

#!/bin/bash
#
# Initialize new virtual server using LXC and set up networking and HTTP proxy
#
# Written by: Deni Bertovic <deni.bertovic@dobarkod.hr>
#
# Released into Public Domain. You may use, modify and distribute it as you
# see fit.
#
# This script will:
@badsyntax
badsyntax / find-unused-sass-variables.sh
Last active November 24, 2021 09:59 — forked from axelerator/Find unused variables in sass files
Find unused SCSS variables. Usage: `./find-unused-sass-variables.sh sassDir/`
#!/usr/bin/env bash
#
# Approach:
# 1. Find variable declaration in the form of "$my-var: anyvalue"
# 2. Loop through found variables and find occurrences of each variable in all sass files
# 3. Filter out vars that occurred only once
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1
@badsyntax
badsyntax / a.md
Last active December 18, 2015 04:48 — forked from padolsey/a.md
// In Chrome Canary, with Experimental JavaScript enabled...
(function( exports ) {
// Create a reusable symbol for storing
// Emitter instance events
var sym = new Symbol();
function Emitter() {
this[ sym ] = {
@badsyntax
badsyntax / KohanaForumHideRussian.user.js
Created January 11, 2012 13:24 — forked from evopix/KohanaForumHideRussian.user.js
A Chrome UserScript to hide all Russian threads on Kohana's forum.
// ==UserScript==
// @name KohanaForumHideRussian
// @description Hide Russian threads from Kohana forum.
// @include *forum.kohanaframework.*
// ==/UserScript==
! function(){
var items = document.querySelectorAll('ul.DataList li.Item');