Skip to content

Instantly share code, notes, and snippets.

View = require './view'
template = require './templates/thumb'
module.exports = class ThumbnailView extends View
tagName: 'li'
template: template
events:
'click .delete-photo': 'deleteImage'
<div id="left-pane">
<h1 id="product_name">{{product_name}}</h1>
{{#if photos}}
<div class="carousel-wrapper">
<a href="#" class="carousel-btn prev" id="prev"><img src="images/prev.png"></a>
<a href="#" class="carousel-btn next" id="next"><img src="images/next.png"></a>
<ul id="carousel">
{{#photos}}
<li><img src="{{.}}"></li>
{{/photos}}
submitForm: (e) ->
e.preventDefault()
# Reset everything
containsEmail = false
containsPassword = false
shortPassword = false
notValidEmail = false
email = @$el.find('[name="email"]').val()
password = @$el.find('[name="password"]').val()
var async = require('async'); //Dat speed
exports.loadAudioDefault = function(req, res)
{
//This route returns a json object with an array of all the MongoDB documents
//returned by the query. These documents are audio files.
this.db.collection('audio', function(err, collection)
{
var audio = {
'audio':[],
'settings':{
extends layout
block content
div#form
input#userID(type='text', name='user', placeholder='enter username')
br
textarea(type='textarea', name='text', placeholder='enter tweet', id='tweet')
br
button#submitTweet(type='button') Tweet
import sys
file = open(sys.argv[1])
for line in file:
cacheLine = line.strip().replace(' ', '')
if (len(cacheLine[:-1]) >= int(cacheLine[-1])):
print cacheLine[::-1][int(cacheLine[-1])]
@invite = (email, agencyId, callback) ->
(app.get 'users').findOne {email: email}, (error, existingUser) ->
if existingUser
(app.get 'users').update {_id: existingUser._id},
{$addToSet:{agencies:agencyId}}, (error) ->
addToTeam agencyId, existingUser._id, (error) ->
console.log 'here'
app.EmailHandler.invite email, agencyId, ->
callback()
@elbuo8
elbuo8 / gist:5722666
Created June 6, 2013 16:01
Get dependencies in Jenkins
request = require 'request'
cheerio = require 'cheerio'
deps = ["git" ,
"github",
"ssh",
"monitoring",
"favorite",
"gravatar",
@elbuo8
elbuo8 / Sample data
Last active December 20, 2015 17:48
Trolololo
{
github: {
username: "elbuo8"
picture: "ballz",
languages: {"Java": 1, "Coffee": 3, "Python": 7, "Go": 1},
points: 75,
repos: 4,
followers: 7
},
stackoverflow: {
tarname = os.getcwd() + '/' + data['name'] + '.tgz'
tar = tarfile.open(tarname, 'w:gz')
for filename in os.listdir(os.getcwd()):
tar.add(filename)
tar.close()
print tarname
files = {'file': open(tarfile, 'rb')}