Skip to content

Instantly share code, notes, and snippets.

View anlek's full-sized avatar
💬
Writing code...

Andrew Kalek anlek

💬
Writing code...
View GitHub Profile
@anlek
anlek / auto_dubstep.rb
Created February 3, 2018 20:13 — forked from xavriley/auto_dubstep.rb
Auto generating dubstep with Sonic Pi
# DUBSTEP
# Combines ideas from my other gists
current_bpm = 140.0
use_bpm current_bpm
# WOBBLE BASS
define :wob do
use_synth :dsaw
lowcut = note(:E1) # ~ 40Hz
highcut = note(:G8) # ~ 3000Hz
@anlek
anlek / wicked_pdf.rb
Created February 14, 2012 18:46 — forked from simmogs/wicked_pdf.rb
Using Wicked_PDF with Rails 3.1
#in config/initializers/wicked_pdf.rb
module WickedPdfHelper
def wicked_pdf_stylesheet_link_tag(*sources)
sources.collect { |source|
"<style type='text/css'>#{Rails.application.assets.find_asset("#{source}.css")}</style>"
}.join("\n").gsub(/url\(['"](.+)['"]\)(.+)/,%[url("#{wicked_pdf_image_location("\\1")}")\\2]).html_safe
end
def wicked_pdf_image_tag(img, options={})
image_tag wicked_pdf_image_location(img), options
class UploadController < ApplicationController
def admission
@all=Upload.all
params[:upload]['item'] += "_#{Time.now.to_i}" if params[:upload]['item'].present?
#doing Time.now.to_i will give you better results for filenames then to_s
@upload=Upload.new(params[:upload])
#@upload.uploaded_at = Time.now #This should happen automagically though
if @upload.save
flash[:notice]="File uploaded successful,please wait for processing "
else
var Driver = {
add: function(event) {
event.stop();
$(this.get('rel'))
.insert(Driver.template(this))
.subNodes().last().show('fade');
},
remove: function(event) {
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end
alias reload='. ~/.bashrc'
alias ea="$EDITOR ~/bin/dotfiles/bash/aliases && reload"
alias ee="$EDITOR ~/bin/dotfiles/bash/env && reload"
alias eh="$EDITOR ~/bin/dotfiles/bash/heroku && reload"
# Processes
alias tu='top -o cpu'
alias tm='top -o vsize'
# Projects
THIS DOCUMENT MOVED TO http://chneukirchen.github.com/rps/
AND http://github.com/chneukirchen/rps
= Ruby Packaging Standard
The aim of this document is two-fold. First, to specify a common
structure of how a Ruby package distributed as source (that is, but
not limited to, development directories, version-controlled
repositories, .tar.gz, Gems, ...) should conform to.