Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react';
import classnames from 'classnames';
import ResultList from './ResultList';
import ResultJSON from './ResultJSON';
const RESULT_TAB = 'RESULT_TAB';
const JSON_TAB = 'JSON_TAB';
class GeocodingResults extends Component {
constructor(props) {
super(props);
this.state = {
import React, { Component } from 'react';
class GeocodingForm extends Component {
constructor(props) {
super(props);
this.state = {
isLocating: false,
};
this.handleGeoLocation = this.handleGeoLocation.bind(this);
this.handleInputChange = this.handleInputChange.bind(this);
this.handleSubmit = props.onSubmit;
import React, { Component } from 'react';
import Header from './Header';
class App extends Component {
render() {
return (
<div>
<Header />
<div className="columns">
<div className="column">1</div>
<div className="column">2</div>
// ./src/Header.js
import React, { Component } from 'react';
import logo from './opencage-white.svg';
import './Header.css';
class Header extends Component {
render() {
return (
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
/* ./src/Header.css */
.App {
}
.App-logo {
animation: App-logo-spin 10s linear;
height: 40vmin;
}
.App-header {
text-align: center;
background-color: #20b282;
@tsamaya
tsamaya / build.gradle
Created August 23, 2018 12:08
detectOS with gradle
import org.gradle.internal.os.OperatingSystem;
task detect {
doLast {
println("Groovy/Java says the current OS is " + System.getProperty("os.name"));
println("Gradle says the current OS is " + OperatingSystem.current())
println("Is this Linux? " + (OperatingSystem.current().isLinux() ? "Yup" : "Nah"))
println("Is this Mac OS X? " + (OperatingSystem.current().isMacOsX() ? "Yup" : "Nah"))
println("Is this Windows? " + (OperatingSystem.current().isWindows() ? "Yup" : "Nah"))
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const N = 1000000;
const STR = 'abcdefghijkl';
function simpleConcat() {
let str = '';
for (let i = 0; i < N; i++) {
str += STR;
}
return str;
}

tmux cheatsheet

running tmux

start new with session name:

tmux new -s myname

attach:

tmux a # (or at, or attach)

@tsamaya
tsamaya / README.md
Created January 23, 2018 10:48
Global .gitignore
touch ~/.gitignore
git config --global core.excludesfile ~/.gitignore
# Created by https://www.gitignore.io/api/osx

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride