Skip to content

Instantly share code, notes, and snippets.

@josevalim
josevalim / _yerb.rb
Created March 18, 2010 16:41
Who needs HAML when you have YAML + ERB?
# = YERB
#
# Who needs HAML when you have YAML + ERB? ;)
#
# See example.yaml below for an example. You can run this code
# by cloning this gist and then `ruby _yerb.rb example.yaml`.
#
# Notice that you need Ruby 1.9 so the hash order is preserved.
# Obviously, this is just for fun. Definitely slow as hell.
#
<html>
<head>
<title>We love shadows! A dynamic light source example created with JavaScript and CSS3</title>
<meta name="description" content="An example created by Sandro Paganotti trying to reproduce a light source effect using Javascript and CSS3" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light' rel='stylesheet' type='text/css'>
<style>
body{
background: #575757;
@crazylion
crazylion / hook.rb
Created September 21, 2011 16:19
change author
# location lib/plugins/assign_author/hook.rb
#如果使用者想要透過webservice指定作者的話,http 參數給予author_login即可。
# 此欄位為user table的 login欄位
module AssignAuthor
class Hooks < Redmine::Hook::ViewListener
def controller_issues_new_before_save(context={})
if context[:params]["author_login"]
u=User.find_by_login(context[:params]["author_login"])
@xdite
xdite / gist:1273518
Created October 9, 2011 10:07
Octopress Wordpress converter
require 'fileutils'
require 'date'
require 'yaml'
require 'rexml/document'
require 'ya2yaml'
include REXML
doc = Document.new(File.new(ARGV[0]))
@crazylion
crazylion / gist:1369427
Created November 16, 2011 06:32
init.d
#!/bin/bash
start(){
echo "start listening fssm"
/etc/xxx/listen.rb &
}
stop(){
echo "stop listening fssm"
killall listen.rb
@zx1986
zx1986 / dabblet.css
Created January 6, 2012 06:08 — forked from secondfret/dabblet.css
Design Shack CSS Mouse In/Out Example 4
/**
* Design Shack CSS Mouse In/Out Example 4
*/
#loremdiv {
margin: 100px;
height: 200px; width: 200px;
background: black;
-webkit-transition: -webkit-border-radius 0.5s ease-in;
@imathis
imathis / 2.1-preview.markdown
Last active September 30, 2015 14:58
How to beta test Octopress 2.1 (including link logs)

Before you get started

Be aware this is a preview. Don't merge this into your main branch and run along using it. I've tested it a lot but there may be issues I'm unaware of. Create a test branch for your blog before you continue. When everything gets cleared up, I'll release this feature and you can pull from the master branch.

First be sure you have a remote pointing to the Octopress repository. git remote -v should return something like this:

octopress      git://github.com/imathis/octopress.git (fetch)
@danielres
danielres / README.markdown
Created July 22, 2012 00:19
Using Font Awesome with Octopress
  1. Download Font Awesome (source)
  2. Take the file sass/font-awesome.sass and put it in your octopress sass folder
  3. Rename it to _font-awesome.sass
  4. Create a directory 'octpress/source/fonts' and put there the 4 font files (ttf, svg, eot and woff).
  5. In your stylesheet:
  • $fontAwesomePath: "fontawesome-webfont"
  • @import font-awesome

Done !

@thx0701
thx0701 / gist:3816226
Created October 2, 2012 04:51 — forked from chihchun/gist:753181
NextVOD
本頁更新以
http://www.osslab.com.tw/Hardware/Open_Embedded_System/NextVOD_unit_Hacking_-_%E7%B6%B2%E6%A8%82%E9%80%9A%E6%94%B9%E6%A9%9F 為主
壹多媒體娛樂服務股份有限公司 壹網樂/網樂通, https://www.nextvod.com.tw/ #nextvod #nextv
H/W
STMicroelectronics STx7105 (Renesas SuperH Core)
VIA VT6113 (Ethernet)
NANYA NT5TU64M16GG-AC (DRAM DDR2 64Mx16 PC800 BGA) * 2= 256MBytes
Samsung NCDOM08GMS-MLC (USB DOM 8GB)
@colinfrei
colinfrei / deploy.rb
Created November 8, 2012 13:00
Capistrano recipe to add an htaccess file when deploying
# [...]
set :htaccess_username, "User"
set :htaccess_password, "Password"
#set :htaccess_password_hashed, "zJDC6IeGdG8QU"
before "deploy:create_symlink", "deploy:htaccess_protect"
# [...]