Skip to content

Instantly share code, notes, and snippets.

View minikomi's full-sized avatar
🍕
I like pizza

Adam Moore minikomi

🍕
I like pizza
View GitHub Profile
@minikomi
minikomi / dp206.rkt
Created March 19, 2015 02:36
Daily Programmer #206
#lang racket
(define width 91)
(define height 51)
(define radius 9)
(define test-input #<<GRID
......x...x....x............x............x.................................x...............
.........x...........x...................x.....x...........xx.............x................
...........x.................x.x............x..........................x................x..
......x...x.....................x.....x....x.........x......x.......x...x..................
@minikomi
minikomi / test.ps
Last active August 29, 2015 14:23
hmm
/radius 0 def
/currentgray 1 def
/pagewidth currentpagedevice /PageSize get 0 get def
/pageheight currentpagedevice /PageSize get 1 get def
/incRadius {
/radius radius 8 add def
} def
/radius 0 def
/currentgray 1 def
/pagewidth currentpagedevice /PageSize get 0 get def
/pageheight currentpagedevice /PageSize get 1 get def
/incRadius {
/radius radius 6 add def
} def
@minikomi
minikomi / gist:629601
Created October 16, 2010 09:04
Get products in same categories
<% @taxons = @product.taxons
@taxons.find(:all).each do |a|
Product.in_taxons(a).each do |product|
%>
<p>
<%= product.name %>
</p>
<% end %>
<% end %>
var add_image_handlers = function() {
$('ul.thumbnails li').eq(0).addClass('selected');
$('ul.thumbnails li a').click(function() {
$("#main-image").data('selectedThumb', $(this).attr('href'));
$('ul.thumbnails li').removeClass('selected');
$(this).parent('li').addClass('selected');
return false;
}).hover(
function() {
require "sinatra"
require "coffee-script"
get '/js/:scriptname' do
coffee params[:scriptname].intern
end
get "/" do
"<script src='/js/test'></script>"
end
@minikomi
minikomi / gist:924979
Created April 18, 2011 08:18
Redirection for unfound assets to dropbox for padrino
error 404 do
link = "http://dl.dropbox.com/u/#{dropboxid}/#{public_folder}"+request.path_info
uri = URI.parse(link)
response = nil
Net::HTTP.start(uri.host, uri.port) { |http|
response = http.head(uri.path.size > 0 ? uri.path : "/")}
if response.code == "200"
redirect link
else
redirect '/' #any place you like, can be 404 page.
フレームワークを作る。
s - "script"
d - "database"
e - "template"
c - "css"
padrino g project blog -s jquery -d activerecord -e haml -c sass
cd blog
bundle install
$(document).ready ->
###
place-holder for animation loop
###
animate = ""
###
set canvas to a variable
###
canvas = document.getElementById("canvas")
@minikomi
minikomi / gist:1094800
Created July 20, 2011 11:34 — forked from jsmpereira/gist:1094024
Padrino pagination
#
# Adapted from http://pastebin.com/FL5KeQQH
#
# As mentioned on the link above put this on app/helpers/pagination.rb
# and you can use in your view
#
# =will_paginate @posts
#
# I'm also using this https://gist.github.com/837683
#