Skip to content

Instantly share code, notes, and snippets.

View lzyzsd's full-sized avatar
:octocat:

Young for you lzyzsd

:octocat:
  • Open Source
  • singapore
View GitHub Profile
@lzyzsd
lzyzsd / skills.dust
Created December 16, 2011 08:00 — forked from vybs/skills.html
{#profile_skill}
<div class="section" id="profile-skills" style="display:block">
<div class="header">
<h2>{@pre:i18n text="Skills"}</h2>
</div>
{?skills} {! we still want to display the Skills heading, even if the number of skills is zero !}
<div class="content">
<ol class="skills" id="skills-list">
{#skills}
<li class="competency show-bean">
@lzyzsd
lzyzsd / form.dust
Created December 16, 2011 08:00 — forked from vybs/basic_form.html
add position
<div class="guided-edit">
{>_close_action/}
{<closeText}{i18n_text_plain__close}{/closeText}
{?firstTaskTitleString}
<h1>{firstTaskTitleString|s}</h1>
{/firstTaskTitleString}
<form class="standard-form" id="{name}_id" name="{name}" method="{method}" action="{action}">
<fieldset>
<legend>{i18n_text_plain__what_is_your_industry}</legend>
@lzyzsd
lzyzsd / articles.dust
Created December 16, 2011 08:00 — forked from vybs/articles.html
articles
<div id="today_feed" class="grid unit_8">
<div id="today_feed-updates" class="unit_8 alpha omega">
{>"Polling"/}
</div>
<div id="today_feed-articles" class="unit_8 alpha omega">
<ul class="articles">
{#content}{#news_container_section}{#newsList}
{>"Article"/}
{/newsList}{/news_container_section}{/content}
</ul>
@lzyzsd
lzyzsd / n1.rb
Created June 13, 2012 02:09 — forked from dchentech/n1.rb
1、11、111、1111、……的平方
# http://www.bjt.name/2011/06/beautiful-math-triangle-r/
proc do |line|
(1..line).each do |num|
puts "#{' '*(line - num)}#{('1'*num).to_i**2}"
end
end.call((ARGV[0] || 36).to_i)
/* MODELS */
var ProjectCollection = function(projects){
var self = this;
var projects = projects;
this.create = function(attrs){
projects.push(attrs)
// might want to a bit of ajax here
@lzyzsd
lzyzsd / DataPrepare.py
Created December 10, 2012 14:17 — forked from royguo/DataPrepare.py
NavieBayes
#!/usr/bin/env python
# encoding: utf-8
"""
author: royguo1988@gmail.com
"""
import os
import random
import re
class DataPrepare(object):
@lzyzsd
lzyzsd / index.js
Created April 22, 2013 14:12 — forked from FokkeZB/index.js
function doClick(e) {
alert('Clicked!');
}
// Remove the event listener like this:
// $.myWidget.off("click", doClick);
$.index.open();
// this is your app.js
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// define our main window and open it. it will be an activity (navBarHidden: true), and will control our child window views
Titanium.UI.createWindow({
navBarHidden: true,
backgroundColor: '#fff',
url: 'mainwindow.js',
exitOnClose: true
save_button.addEventListener('click', ()->
if Ti.Filesystem.isExternalStoragePresent
save_image = Ti.Filesystem.getFile(path).read()
new_path = Titanium.Filesystem.externalStorageDirectory + Date.now().toString() + ".png"
f = Ti.Filesystem.getFile(new_path)
result = f.write(save_image)
unless result
return null
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git