Skip to content

Instantly share code, notes, and snippets.

@thislooksfun
thislooksfun / progress.htm
Created September 7, 2015 04:03
Simple html5 / css3 / js progress bar example. Go nuts.
<html>
<head>
<title>Progress bar testing</title>
<style>
body {
background-color: #444;
margin: 0 25%;
}
.bar_container {
@thislooksfun
thislooksfun / upload
Last active June 26, 2016 23:32
Work with Screeps modules in folders
mkdir dist
cd javascript
for f in $(find . -name '*.js'); do
f1="${f/.\//}"
cp $f "../dist/${f1//\//.}"
done
cd ..
grunt screeps
  1. Mount BOOTCAMP disk
  2. Run 'diskutil info /Volumes/BOOTCAMP'
  3. Run 'sudo vifs' and replace old id with the value taken from 'Volume UUID' from the 'diskutil list' above'

More info (Hopefully this link doesn't die like the last one did...)

@thislooksfun
thislooksfun / gquit
Created February 21, 2017 01:54
Small Bash script to gently quit applications from the command line
#!/bin/bash
if [ $# -eq 1 ]; then
echo "Quitting '$1'"
osascript -e "quit app \"$1\""
else
echo -e " Usage:\n gquit [Application Name]"
fi
@thislooksfun
thislooksfun / mod_migrator.sh
Last active May 1, 2017 05:39
A simple mod migration script for Factorio 0.14 -> 0.15
#!/bin/bash
VERSION="1.1.1"
# ██ ██ ███████ ██████ ██ ███████ ██ ██ █████ ██████ ██████ ███████
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ██ ██ █████ ██████ ██ █████ ████ ███████ ██████ ██ ███ ███████
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ████ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██████ ███████
@thislooksfun
thislooksfun / .bash_profile
Last active May 9, 2017 18:09
My personal .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#!/usr/bin/env node
const DEFAULT_KEY = "out";
function setOutput(name, val) {
console.log(`::set-output name=${name}::${val}`);
}
function parseAndOutput(data) {
try {
# ------------------------------------------------
# Generic C Makefile
#
# Adapted from https://stackoverflow.com/questions/7004702
# ------------------------------------------------
##### START CONFIG #####
### START BASIC CONFIG ###

Tips for C

  1. To stop vscode complaining about struct sigaction, add #define _GNU_SOURCE.
/* ==UserStyle==
@name Salamanstra
@author Cascadea User
@version 1.0
@namespace cascadea188508083
@preprocessor default
==/UserStyle== */
@-moz-document domain("salamanstra.keenspot.com")
{