Skip to content

Instantly share code, notes, and snippets.

@dweldon
dweldon / meteor-nginx
Last active January 22, 2024 06:53
This is an example of how to configure nginx to serve a meteor app.
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
@nulltask
nulltask / app.js
Created March 17, 2012 08:46
Output CSV in Express
/**
* Module dependencies.
*/
var express = require('express')
, app = module.exports = express.createServer();
// Configuration
app.use(app.router);
@Yavari
Yavari / README.markdown
Created February 23, 2012 09:00 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
if (Meteor.is_client) {
var userName = "PatelNachiket";
Template.hello.greeting = function () {
return "Fetch recent tweets from Twitter stream of user : " ;
};
Template.hello.events = {
'click #fetchButton' : function () {
console.log("Recent tweets from stream!");
$('#fetchButton').attr('disabled','true').val('loading...');
@zacharydanger
zacharydanger / smtp.rb
Created February 9, 2012 14:38
Sample Rails ActionMailer config/initializer
# this file should be config/initializers/smtp.rb
config_file = File.join(Rails.root.to_s, '/config/smtp.yml')
if File.exists? config_file
if smtp_config = YAML.load_file(File.expand_path(config_file))[Rails.env]
MyApp::Application.config.action_mailer.delivery_method = :smtp
MyApp::Application.config.action_mailer.smtp_settings = smtp_config
end
end
@nanusdad
nanusdad / handlebars-each-index-key
Created August 6, 2013 05:01
Handlebars - each with @key and @Index
When looping through items in each, you can optionally reference the current loop index via {{@index}}
{{#each array}}
{{@index}}: {{this}}
{{/each}}
For object iteration, use {{@key}} instead:
{{#each object}}
{{@key}}: {{this}}
@gt-gist
gt-gist / client.js
Created January 10, 2013 09:23
Meteor: autocomplete text by bootstrap typeahead
Template.myform.rendered = function () {
return Meteor.defer(function () {
return $('.item-select').typeahead({
source: items