Skip to content

Instantly share code, notes, and snippets.

View SeanPlusPlus's full-sized avatar

Sean Stephenson SeanPlusPlus

View GitHub Profile
@SeanPlusPlus
SeanPlusPlus / rxGet.js
Created February 19, 2017 21:03
network request with rxjs
import Rx from 'rxjs';
import axios from 'axios';
const url = 'https://api.github.com/users/SeanPlusPlus'
const requestStream = Rx.Observable.of(url);
const responseStream = requestStream
.flatMap(requestUrl =>
Rx.Observable.fromPromise(axios.get(requestUrl))
);
responseStream.subscribe(response => {
@SeanPlusPlus
SeanPlusPlus / package.json
Last active February 19, 2017 21:02
starting point for package.json
{
"name": "startingPoint",
"version": "1.0.0",
"main": "app.js",
"license": "MIT",
"scripts": {
"start": "nodemon app.js --exec babel-node --presets es2015,stage-2"
},
"dependencies": {
"nodemon": "^1.11.0"
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_email(message, recipient, subject):
# verify we have the creds
password = os.environ.get('EMAIL_PW', None)
def auth_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
user_info = {}
if ENV == 'dev':
user_info["login"] = DEV_LOGIN
user_info['is_admin'] = True
else: # in prod
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="response received">
<meta name="author" content="stoked">
<title>Response Recieved</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
const MY_ARR = [
{
name: 'foo',
},
{
name: 'bar',
{
'.editor:not(.mini)': {
'ctrl-b |': 'pane:split-right',
'ctrl-b _': 'pane:split-down',
'ctrl-h': 'window:focus-pane-on-left',
'ctrl-l': 'window:focus-pane-on-right',
'ctrl-j': 'window:focus-pane-below',
'ctrl-k': 'window:focus-pane-above',
},
'atom-workspace':
import React from 'react';
import { Bar as BarChart } from 'react-chartjs';
class HelloChart extends React.Component {
constructor() {
super();
const data = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [{
label: "My First dataset",
'use strict';
// <p ng-bind-html="mytext | linkify | trustHTML"></p>
angular.module('myApp.filters', []).
filter('trustHTML', ['$sce', function ($sce) {
return function (text) {
return $sce.trustAsHtml(text)
}
a,200;202;205
b,302;60;3100
c,50;200