Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
View app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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...'); |
View oauth_twitter_API_meteorjs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = Npm.require('crypto'), | |
consumerKey = 'consumerKey', | |
consumerSecret = 'consumerSecret', | |
accessToken = 'accessToken', | |
accessTokenSecret = 'accessTokenSecret', | |
url = 'https://api.twitter.com/1.1/statuses/home_timeline.json', | |
date = new Date, | |
method = 'GET'; |
View meteor-oauth-client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AUTH_URL = "https://api.glitch.com/oauth2/authorize?response_type=code&client_id=000yourclientid000&redirect_uri=http://yoursitehere/oauth/&scope=identity"; | |
var Auth_Router = Backbone.Router.extend({ | |
routes: { | |
"": "root", | |
"oauth/?code=:code": "auth" | |
}, | |
root: function () {}, | |
auth: function (code) { | |
Meteor.call('authenticate', code, function (error, result) { |
View oauth_twitter_API_meteorjs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = Npm.require('crypto'), | |
consumerKey = 'consumerKey', | |
consumerSecret = 'consumerSecret', | |
accessToken = 'accessToken', | |
accessTokenSecret = 'accessTokenSecret', | |
url = 'https://api.twitter.com/1.1/statuses/home_timeline.json', | |
date = new Date, | |
method = 'GET'; |
View designer.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../topeka-elements/theme.html"> | |
<link rel="import" href="../topeka-elements/topeka-resources.html"> | |
<link rel="import" href="../topeka-elements/topeka-app.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
View regular-expressions.cheatsheet.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SYNTAX: | |
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches) | |
var pattern = /pattern/attributes; # same as above | |
# BRACKETS: | |
[...]: Any one character between the brackets. | |
[^...]: Any one character not between the brackets. |
View mongo-dump-csv.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OIFS=$IFS; | |
IFS=","; | |
# fill in your details here | |
dbname=DBNAME | |
user=USERNAME | |
pass=PASSWORD | |
host=HOSTNAME:PORT | |
# first get all collections in the database |
View gist:312d0f7582a526af310b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Asynchronous Method. | |
Meteor.startup(function () { | |
console.log('starting up'); | |
var fs = __meteor_bootstrap__.require('fs'); | |
fs.readFile('file.json', 'utf8', function (err, data) { | |
if (err) { | |
console.log('Error: ' + err); | |
return; | |
} |
View meteor-get-real-ip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
// Get the connections *real* IP | |
getConnectionIP: function () { | |
// No need to make others wait | |
this.unblock(); | |
// Locals | |
var conn = this.connection; |
OlderNewer