Skip to content

Instantly share code, notes, and snippets.

@wschenk
wschenk / gist:86e1e87772e7d589e963
Last active March 18, 2016 15:24
Basic twitter CLI to see what's going on
require 'thor'
require 'twitter'
require 'httparty'
TWITTER_APP_KEY="rzlJX...."
TWITTER_APP_SECRET="euF5bI...."
TWITTER_ACCESS_TOKEN="17827...."
TWITTER_ACCESS_TOKEN_SECRET="7NSXm..."
def print_user_info( u )
@wschenk
wschenk / gist:7d333acb59b7768f2637
Last active August 29, 2015 14:09
Stand alone net checker from Social Investigator
#!/usr/bin/env ruby
require 'httparty'
require 'nokogiri'
require 'dnsruby'
require 'whois'
require 'whois/record/parser/blank'
require 'whois/record/contact'
url = ARGV[0] || "http://www.fastcolabs.com/3038014/product-bootcamp-week-six-worth-it"
@wschenk
wschenk / ga.rb
Created December 4, 2014 22:48
Scripting Google Analytics with ruby-api-client
#!/usr/bin/env ruby -KU
#
# This code has been adapted from
# https://github.com/google/google-api-ruby-client-samples/tree/master/drive
#
require 'thor'
require 'hirb'
require 'google/api_client'
require 'google/api_client/client_secrets'
@wschenk
wschenk / Rakefile
Last active May 5, 2018 22:04
Download medium posts and convert to markdown
require "upmark"
require 'csv'
require 'fileutils'
user = "wschenk"
workingdir = "medium"
outputdir = "articles"
def url( dest, source )
file dest do
@wschenk
wschenk / index.js
Created November 27, 2017 17:25
create-react-app index.js file using material-components-web css
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import 'material-components-web/dist/material-components-web.css'
import WebFont from 'webfontloader'
WebFont.load({
google: {
@wschenk
wschenk / navbar.js
Last active November 28, 2017 03:02
create-react-app navabar.js rmwc example
import React, {Component} from 'react';
import {Toolbar, ToolbarRow, ToolbarSection, ToolbarMenuIcon, ToolbarTitle, ToolbarIcon} from 'rmwc';
export default class Navbar extends Component {
render() {
return (
<Toolbar>
<ToolbarRow>
<ToolbarSection alignStart>
<ToolbarMenuIcon use="menu" onClick={this.props.toggle}/>
@wschenk
wschenk / login.js
Created November 28, 2017 02:41
create-react-app login.js rmwc example
import React, {Component} from 'react'
import { TextField, Dialog } from 'rmwc';
class Login extends Component {
state = {email: "", password: ""}
handleChange = (val) => (evt) => { this.setState( {...this.state, [val]: evt.target.value} ) }
loginForm = () => {
return (
<div>
@wschenk
wschenk / drawer.js
Created November 28, 2017 02:46
create-reate-app drawer.js rmwc example
import React, {Component} from 'react';
import {PersistentDrawer, PersistentDrawerHeader, PersistentDrawerContent, ListItem, ListItemText } from 'rmwc';
export default class Drawer extends Component {
render() {
return (
<PersistentDrawer open={this.props.opened}>
<PersistentDrawerHeader style={{ backgroundColor: '#f6f6f6' }}>
PersistentDrawerHeader
</PersistentDrawerHeader>
@wschenk
wschenk / grid.js
Last active January 22, 2018 08:57
create-react-app grid.js rmwc example
import React, {Component} from 'react'
import {
GridList,
GridTile,
GridTilePrimary,
GridTilePrimaryContent,
GridTileSecondary,
GridTileTitle } from 'rmwc'
class Grid extends Component {
@wschenk
wschenk / App.js
Created November 28, 2017 03:07
create-react-app App.js rmwc example
import React, { Component } from 'react'
import Navbar from './navbar'
import Drawer from './drawer'
import Login from './login'
import Grid from './grid'
class App extends Component {
state = { drawer: false, login: false }
drawerToggle = () => { this.setState( { ...this.state, drawer: !this.state.drawer } ) }