Skip to content

Instantly share code, notes, and snippets.

@radamant
radamant / bauhaus.cfdg
Created September 21, 2016 00:26
bauhaus
CF::Background = [b -0.9 sat 0]
startshape field[]
primary_color = [h 360 sat 0.9 b 0.7]
secondary_color = [h 190 sat 0 b 0.9]
adjustment pick_color() = select(randint(2), primary_color, secondary_color)
shape field {
loop 4 [x (randint(3) * randint(-1,1))]{
the_color = [trans pick_color()]
startshape space[h 80..300 sat 1 b 0.4..1]
shape space {
loop 20 [x 1 y 1.5 h -20..20 r 0..360] {
petals(-0.5..0.5, -0.5..0.5)[]
}
}
shape petals (movex, movey) {
loop 4 [r 90 x 0.4 y 0.4 sat 1 b 1]
@radamant
radamant / index.js
Created May 26, 2016 18:34
Flowdock User Audit
var Client = require('node-rest-client').Client;
var apiToken = process.argv[2];
var auth = { user: apiToken, password: ""};
var client = new Client(auth);
const ALL_FLOWS_URL = "https://api.flowdock.com/flows/all?users=1";
function getResource(url, success) {
client.get(url, function(data, response){
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
require 'socket'
def usage
puts 'ruby huemato_client.rb (start|stop|status|party)'
abort
end
command = ARGV[0]
usage unless command
@radamant
radamant / find-self-in-inits-objc.sh
Created October 15, 2013 21:40
Finds init* methods in Objective-C that contain self.property=value
find code-folder/ -name '*.m' -exec pcregrep -M 'init.*(\n|[\{])+\{(\n|[^\}])+self\.(\n|[^\}])+\}' {} \; -exec echo "Filename: " {} \;q
#include <iostream>
#define ASTRO_UNITS_PER_LIGHT_YEAR 63240
float lightYearsToAstronomicalUnits(float);
int main()
{
using namespace std;
cout << "Enter the number of light years: ";
float lightYears;
(defface term-color-black
'((t :foreground "black" :background "black"))
"Face used to render black color code."
:group 'term)
(defface term-color-red
'((t :foreground "red3" :background "red3"))
"Face used to render red color code."
:group 'term)
'(ansi-color-names-vector ["#3f3f3f" "#cc9393" "#7f9f7f" "#f0dfaf" "#8cd0d3" "#dc8cc3" "#93e0e3" "#dcdccc"])
'(ansi-term-color-vector [unspecified "white" "red" "green" "yellow" "royal blue" "magenta" "cyan" "white"] t)
chef_gem 'mysql'
include_recipe "mysql::ruby"
mysql_database node['mysql']['database_name'] do
connection({:host => "localhost", :username => 'root', :password => node['mysql']['server_root_password']})
action :create
end