Skip to content

Instantly share code, notes, and snippets.

View vybs's full-sized avatar

Veena Basavaraj vybs

View GitHub Profile
@vybs
vybs / partial
Created July 10, 2012 14:57
Partial and param helper for creating local scope
/**
* helper for including re-usable shared partials such as degree icon, miniprofile and ads
* @method partial
* @param {Object} params a configuration object created from attributes set in the template.
* template param specifies the partial template to be rendered --optional
* key params specifies the special context for the partial tag data --optional, defaults to creating tag data in partial block
*/
dust.helpers.partial = function( chunk, context, bodies, params ){
var partial = {};
if( params) {
@vybs
vybs / skills.html
Created December 9, 2011 00:30
simple skills list dust template
{#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">
@vybs
vybs / basic_form.html
Created December 9, 2011 01:44
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>
@vybs
vybs / suggest_form.html
Created December 12, 2011 19:34
connection_suggester dust template
{#data}
<div id="connection-suggester-dialog">{! /* DIALOG WRAPPER */ !}
<div class="connection-suggester-picker">{! /* DIALOG PICKER WRAPPER */ !}
{! /* SUGGESTER TOOLS */ !}
<div class="connection-sugg-head">
{! /* SEE ALL/SELECTED BUTTONS WITH COUNTS */ !}
<a href="#" class="show-selected btn-quaternary disabled">
<span class="selected">{.connection_suggester__input_value__see_selected} <b></b></span>
@vybs
vybs / articles.html
Created December 12, 2011 19:53
news articles dust template
{! article dust template with partials for polling and pagination !}
<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"/}
@vybs
vybs / rhino_dust.java
Created January 17, 2012 02:15
Sample code to rendering dust template using Rhino
package com.linkedin.dust.renderer;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Writer;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.JavaScriptException;
@vybs
vybs / form_template.js
Created January 17, 2012 02:11
Reuse partials in dust with override contexts
<form class="standard-form" id="{name}_id" name="{name}" method="{method}" action="{action}">
<fieldset>
<p class="task-content">Worked from</p>
<ul>
{! showStartDate !}
<li class="start-date" style="display:none">
{#startDateMonth choose="Choose"}
{>singleSelect/}
{/startDateMonth}
@vybs
vybs / compass_compiler.rb
Created December 19, 2011 03:37
compass compiler code in ruby that can be invoked from an ant task as well
require 'rubygems'
require 'sass'
require 'compass'
require 'compass/exec'
class COMPASS_COMPILER
def self.compileme(filename, locale)
$LOAD_PATH.unshift "#{filename}.scss"
@vybs
vybs / locale_specific.css
Created December 19, 2011 02:10
Convert from sass to css using compass, generate locale specific rules
require 'rubygems'
require 'compass'
require 'compass/exec'
## start sass css converter
class SASS_CSS
module Sass::Script::Functions
def user_language()
Sass::Script::String.new(options[:custom][:lang])