Skip to content

Instantly share code, notes, and snippets.

@Savjee
Savjee / gist:b4b3a21d143a30e7dc07
Created January 16, 2016 18:49
s3-webhosting-bucket-policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@ctaloi
ctaloi / accountsValidate.js
Created September 3, 2015 13:59
Validate a new Meteor account based on email suffix
function checkEmailAddress(emailAddress) {
check(emailAddress, String);
suffix = emailAddress.split('@')[1];
if (suffix === "wcs.com")
{ return true } else { return false };
};
Accounts.validateNewUser(function (user) {
console.log(user);
if (checkEmailAddress(user.emails[0].address)) {
import ProductTable from './product-table'
import SearchBar from './search-bar'
div
SearchBar(filterText=state.filterText
inStockOnly=state.inStockOnly
handleUserInput=this.handleUserInput
)
ProductTable(filterText=state.filterText
inStockOnly=state.inStockOnly
products=props.products
@pixelbacon
pixelbacon / MomentJS-iteration.js
Last active May 24, 2021 08:44
MomentJS iterate through daily start/end, check for clashes
var moment = require('moment'); // http://momentjs.com/docs/
var _ = require('lodash'); // https://lodash.com/docs
function(collectionsWithDateValues){
var slots = [];
var hours = {
start: 7, // 7am
end: 21, // 9pm
window: 2 // How long each item should be slotted for.
};
@benstr
benstr / package-symlink-instructions.md
Created November 3, 2014 22:09
How to modify an Atmosphere package with forking and symlink
@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing

TL;DR

A query defines a set of conditions on a collection of documents. Most of the time, only the documents that meet these conditions need to be published to the client. In many cases the query's conditions are subject to the state of the application (for instance the selected sorting field). This pattern describes how to update your query's result set reactively with meteor without losing the cursor's state. This way, results are preserved over different adjustements of a query if they meet both set of conditions.

an example case

To illustrate this pattern best, we'll be using the following example case throughout.

Let's say you have a collection of Players and a collection of Games. We track each score in a Scores collection. Some example data:

Players:

## Meteor Patterns ##
----------
# Simple Search
- Avoid duplicating the same query code on the client and server.
- Provide some simple search results.
> common/utils.js
@agilous
agilous / rails-on-nitrous.md
Last active January 29, 2018 14:24
Web Development with Ruby on Rails and Nitrous.IO.

Web Development with Ruby on Rails and Nitrous.IO.

Introduction

We will create a simple "Wish List" Web application using Ruby on Rails (Rails) and Nitrous.IO (Nitrous).

Rails is a Web application development framework written in the Ruby programming language. It follows a "convention over configuration" philosophy that allows developers to quickly create valuable products if they choose to follow convention. However, Rails is powerful enough to to create applications like Twitter and Groupon.

Nitrous is a Web-based application development service. It permits software developers to focus on writing code and less on the intricacies of their development environment. Their tagline is, "making coding in the cloud a reality." Using Nitrous, you are literally programming a server running in "The Cloud."

@friggeri
friggeri / haiku
Created October 6, 2011 07:30
random heroku-like name generator
haiku = ->
adjs = [
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",