Skip to content

Instantly share code, notes, and snippets.

View BinaryMuse's full-sized avatar
🏳️‍🌈
Just gayin' up the place the best I can

Michelle Tilley BinaryMuse

🏳️‍🌈
Just gayin' up the place the best I can
View GitHub Profile
require 'coderay'
codeToHighlight = `pbpaste`
highlightedCode = CodeRay.scan(codeToHighlight, :ruby).div
IO.popen("pbcopy", mode='w') do |io|
io.write highlightedCode
end
@BinaryMuse
BinaryMuse / convert_songs.rb
Created April 22, 2011 21:32
Convert a directory (and subdirectories) full of .flac files to .mp3 using ffmpeg
require 'find'
def convertFile(path)
puts "Converting #{path}"
choppedSafeFilePath = path.chomp(File.extname(path))
`ffmpeg -i "#{choppedSafeFilePath}.flac" -ar 44100 -ab 128k -y "#{choppedSafeFilePath}.mp3" 2>/dev/null`
end
Find.find("/media/New Volume/song_directory") do |path|
if File.extname(path) == ".flac"
convertFile path
@BinaryMuse
BinaryMuse / gist:1692713
Created January 28, 2012 05:00 — forked from tiembo/gist:1680416
Ubuntu laptop A/C unplugging suspend fix
# run in command line
gsettings set org.gnome.settings-daemon.plugins.power 'use-time-for-policy' 'false'
@BinaryMuse
BinaryMuse / application.js
Created February 15, 2012 20:21 — forked from lachie/application.js
rails 3.1 asset pipeline + stitch/CommonJS
// in app/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require ./stitch_header
//= require_tree .
@BinaryMuse
BinaryMuse / gist:3231471
Created August 1, 2012 23:14 — forked from swannodette/gist:3217582
sudoku_compact.clj
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
(defn init [vars hints]
@BinaryMuse
BinaryMuse / kinetic.bezier.js
Created September 16, 2012 04:15 — forked from gzoller/kinetic.bezier.js
Kinetic Plug-Ins
/**
* KineticJS Bezier Extension
* Compatible with KineticJS JavaScript Library v3.8.0
* Author: Greg Zoller
* Date: Apr 12 2012
*/
///////////////////////////////////////////////////////////////////////
// Bezier
///////////////////////////////////////////////////////////////////////
@BinaryMuse
BinaryMuse / atcs-controls.js
Created September 22, 2012 18:24
atcs-controls.js
var connect = require('connect');
var fs = require('fs');
var querystring = require('querystring');
var util = require('util');
var pageMarkup = 'Error';
var staticFiles = new Array();
try {
staticFiles['/'] = fs.readFileSync('page.html', 'ascii');
staticFiles['/jquery-1.7.1.min.js'] = fs.readFileSync('jquery-1.7.1.min.js', 'ascii');
@BinaryMuse
BinaryMuse / output
Created November 20, 2012 18:37 — forked from anonymous/output
super hack
module Homepage
module V2
class Board
include Redis::Objects
value :name
value :exists
counter :views
event = require('pilot/event')
Anchor = require('ace/anchor').Anchor
doc = ace_editor.session.getDocument()
editablePositions = [[1, 0, 2, 0]] # allow editong only the second row
jQuery.each editable, (index, row) ->
editablePositions.push [new Anchor(doc, row[0], row[1]), new Anchor(doc, row[2], row[3])]
Range = require('ace/range').Range
@BinaryMuse
BinaryMuse / README.md
Last active January 4, 2016 05:08 — forked from mbostock/.block

A simple example drawing a great arc as a LineString. The projection is rotated to avoid interrupting the arc. See also an earlier example with multiple great arcs.