Skip to content

Instantly share code, notes, and snippets.

@d1rtym0nk3y
d1rtym0nk3y / Ant.sublime-build
Created February 7, 2012 14:16
SublimeText2 Ant build config
// save this as /Users/%user%/AppData/Roaming/Sublime Text 2/Packages/User/Ant.sublime-build
// on windows, or somewhere else on mac/linux
// make sure its "ant.bat" or it will moan about file not found
{
"cmd": ["ant.bat", "-f", "build.xml", "-DBUILD_HOST=local", "main"],
"working_dir": "$project_path"
}
@lmatteis
lmatteis / gist:2507155
Created April 27, 2012 07:52
JSON.parse() not working correctly in Rhino?

Here's the JSON I'm trying to parse:

`{"Name of submitting scientist":" Eva Weltzien","Institution":"ICRISAT Bamako","Language of submission (only in ISO 2 letter codes)":{"english":"En","french":"Fr"},"Date of submission":"11/23/2011","Crop":"Sorghum","Name of Trait":{"english":"Grain covering","french":"Couverture du Grain"},"Abbreviated name ":{"english":"GRNCOV","french":"CvGr"},"Trait ID for modification, Blank for New":{"english":"CO_324:0000043","french":""},"Description of Trait":{"english":"Amount of grain covered by glumes","french":"Observation Visuelle du degr\u00e9 de couverture du grain par les glumes \u00e0 la maturit\u00e9"},"How is this trait routinely used?":{"english":"Nursery","french":"P\u00e9pini\u00e8re"},"Trait Class":"Morphological","Name of method":{"english":"Grain Covering","french":"Ouverture des glumes"},"Describe how measured (method)":{"english":"Visual observation of the recovery level of grain by the glumes at maturity to give a score","french":"Observation visuelle du niv

# requires imagemagick and ffmpeg (tested with latest versions)
# make sure you set an INFILE variable first
# get GIF info
video=$(ffmpeg -i "$INFILE" 2>&1 /dev/null | grep "Video:");
# get GIF Frames per second
fps=$(echo "$video" | sed -n "s/.* \([0-9.]*\) fps.*/\1/p");
# a convinience variable so we can easily set FPS on the video

How to get BennVenn' joey-joebags working on macOS

The joey-joebags is a Game Boy cart reader/writer, it's available here.

I have tested these steps on Yosemite (10.10) and Sierra (10.12). You need to have Python 3, which is not installed by default, so install using Homebrew.

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@pdtyreus
pdtyreus / SlackPostMessageWithAttachments.js
Created September 8, 2016 22:15
Slack chat.postMessage with attachments
var http = require("https");
var querystring = require('querystring');
//2 attachments as JavaScript Objects
var attachments = [{
fallback: "Attachment 1 Fallback",
title: "This is Attachment 1",
text: "Attachment 1 Text",
color: "#3964db"
}, {
@xfalcox
xfalcox / 10USD-AWS
Last active November 19, 2020 02:43
VPS Compare
CPU model: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
Number of cores: 1
CPU frequency: 2394.486 MHz
Total amount of RAM: 990 MB
Total amount of swap: MB
System uptime: 4 min,
I/O speed: 64.0 MB/s
Bzip 25MB: 4.61s
Download 100MB file: 46.5MB/s
@deanputney
deanputney / giffer.sh
Created August 23, 2012 04:39
Giffer - Make gifs from any video
#!/bin/bash
# Installation:
#
# Get yourself ffmpeg and imagemagick.
# brew install ffmpeg
# brew install imagemagick
#
# I put this script at ~/script/giffer.sh and aliased it to giffer.sh
# alias giffer=/Users/<your_username>/scripts/giffer.sh
@coderofsalvation
coderofsalvation / crossfadevideo.sh
Last active December 17, 2023 06:45
ffmpeg commandline crossfade-looped video
#!/bin/bash
[[ ! -n $3 ]] && { echo "Usage: crossfadevideo <input.mp4> <fade in seconds> <output.mp4> [looptimes]"; exit; }
input="$1"
fade="$2"
duration="$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 "$input")"
duration=$(echo "$duration-($fade)" | bc | sed 's/\..*//g')
[[ ${duration:0:1} == "." ]] && duration="0$duration"
output="$3"
[[ -n $4 ]] && loop=$4 && output="${output}.mkv"
set -x
@bhubbard
bhubbard / .htaccess
Last active December 25, 2023 02:59
This is my template .htaccess file for WordPress on Cloud Sites.
# Apache Server Config | MIT License
# https://gist.github.com/bhubbard/6082577
# Modified from https://github.com/h5bp/server-configs-apaches
# ##############################################################################
# # Default WordPress #
# ##############################################################################
# http://randomtype.ca/blog/the-wordpress-htaccess-file-explained/
# BEGIN WordPress
@benjamine
benjamine / alias.cmd
Last active February 19, 2024 15:49
Aliases for windows command line
::
:: Aliases for windows command line
::
:: Installation:
::
:: - create a folder for your aliases (eg: ```c:\cmd-aliases```)
:: - add that folder to your PATH variable
:: - save this script as setalias.cmd on that folder
:: - run "alias" to see usage
::