Skip to content

Instantly share code, notes, and snippets.

saurshaz saurshaz

Block or report user

Report or block saurshaz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@saurshaz
saurshaz / index.html
Last active May 11, 2017
RxJS + fetch data + update UI// source http://jsbin.com/venijo
View index.html
<style id="jsbin-css">
tr {
border-bottom: 1px solid black;
}
</style>
<meta name="description" content="RxJS + fetch data + update UI">
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script><h1>Hello, Rx.js!</h1>
<table>
<thead>
<tr>
@saurshaz
saurshaz / aws-uploader.html
Last active Oct 3, 2016
aws-uploader riot component with server side code
View aws-uploader.html
const riot = require('riot')
<aws-uploader>
<div class='container'>
<form method="POST" action="/save-details">
<input type="file" id="file-input" onchange={initUpload}>
<p id="status">Please select a file</p>
<section if={opts.imagefile === 'true'}>
<img style="border:1px solid gray;width:300px;" id="preview" src="/images/default.png">
<input type="hidden" id="avatar-url" name="avatar-url" value="/images/default.png">
@saurshaz
saurshaz / webtask-github-sample.js
Last active Jul 31, 2016
A webtask to fetch alot of people related in similar stuff. a list of all people following all people that i follow (my siblings)
View webtask-github-sample.js
var async = require('async');
var GitHubApi = require("github@0.2.4");
// module.exports = function (ctx, done) {
// var words = ctx.data.title
// .split(' ')
// .concat(
// ctx.data.excerpt.split(' ')
// );
// MongoClient.connect(ctx.data.MONGO_URL, function (err, db) {
@saurshaz
saurshaz / indexeddb-fetch.js
Created Jul 11, 2016
get data from indexeddb
View indexeddb-fetch.js
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction,
dbVersion = 1.0;
// Create/open database
var request = indexedDB.open("local", dbVersion),
db,
createObjectStore = function (dataBase) {
// Create an objectStore
View my_node.md

A directory structure i use for Node projects

  1. rootproject folder (starting point) 2. project_name folder 3. package.json file 4. node_modules folder (all dependencies) 4. .env file (or/and other non-committed environment/settings files) 5. project_name folder (the folder to contain source code) 6. appfolder (client side files) 7. server folder (server side files)
@saurshaz
saurshaz / react-sample-productlist.js
Created Dec 1, 2015
react code for product listinhg (incomplete without other components)
View react-sample-productlist.js
var React = require('react/addons');
var { PureRenderMixin } = React.addons;
var Fluxxor = require('fluxxor');
var StoreWatchMixin = Fluxxor.StoreWatchMixin;
var Utils = require ('../../Utils');
var EC = require('../../EventConstants');
const SubItem = require('./SubItem');
var ProductListView = React.createClass({
mixins: [
View index.html
<!DOCTYPE html>
<html>
<head>
<script data-require="jquery@2.1.3" data-semver="2.1.3" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" href="style.css" />
<link data-require="bootstrap@3.3.2" data-semver="3.3.2" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script data-require="bootstrap@3.3.2" data-semver="3.3.2" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
View index.html
<!DOCTYPE html>
<html>
<head>
<script data-require="jquery@2.1.3" data-semver="2.1.3" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" href="style.css" />
<link data-require="bootstrap@3.3.2" data-semver="3.3.2" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script data-require="bootstrap@3.3.2" data-semver="3.3.2" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
View CLV computation
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<!--<script src="script.js"></script>-->
<script>
var calculateClv = function(a, b, c, d, e, f) {
@saurshaz
saurshaz / polymer-map
Created Mar 23, 2015
A map search screen in polymer
View polymer-map
<template wid="true">
<data class="wid" name="screen2" datatype="html" data-group="grp1">
<style>[drawer] {
background-color: #B99588;
border-right: 1px solid #ccc;
}
[main] {
background-color: #4F7DC9;
}
You can’t perform that action at this time.