Skip to content

Instantly share code, notes, and snippets.

View johnantoni's full-sized avatar

John Griffiths johnantoni

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@johnantoni
johnantoni / rename-videos.sh
Created February 28, 2019 01:22
remove '-Broadband High' from videos
for i in *.mp4 ; do mv "$i" "${i/-Broadband High*.mp4/.mp4}" ; done
@johnantoni
johnantoni / instructions.md
Last active August 27, 2018 19:27 — forked from zentralwerkstatt/instructions.md
Install Syncthing on Raspberry Pi
  • Install the necessary packages:
sudo apt-get install apt-transport-https ca-certificates
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
sudo apt-get install git
  • Start syncthing once:
@johnantoni
johnantoni / twotableviewsInOneView.swift
Created August 11, 2018 12:39 — forked from mchirico/twotableviewsInOneView.swift
Creating multiple tableViews in one ViewController...this just starts out as a view controller
//
// ViewController.swift
// Delete
//
// Created by Mike Chirico on 10/21/15.
// Copyright © 2015 Mike Chirico. All rights reserved.
//
import UIKit
@johnantoni
johnantoni / gist:d68a2f71ef05c133867927f3992ec56e
Created July 3, 2018 15:32
marker with infobox - draggable
<Marker
position={{ lat: lat, lng: lng }}
onClick={this.onToggleOpen}
editable={true}
draggable={true}
>
{this.state.isOpen &&
<InfoBox
onCloseClick={this.onToggleOpen}
options={{ closeBoxURL: ``, enableEventPropagation: true }}
complete drawing
https://github.com/tomchentw/react-google-maps/issues/796
click-me popup
http://google-map-react.github.io/google-map-react/map/events
react leaflet
https://react-leaflet.js.org/en/
adding marker
@johnantoni
johnantoni / es6-promise.js
Created March 18, 2018 20:33
es6 promises
const save = () => {
return new Promise((resolve, reject) => {
// access the db
// save the file
// when the file is saved successfully
// resolve with the saved document
resolve(doc)
// if there was an error
reject(err)
@johnantoni
johnantoni / app.js
Last active March 14, 2018 17:41
react app.js
import React, { Component } from 'react';
import { Router, Route, Link, Redirect } from 'react-router-dom';
import { getCurrentUser } from './helpers';
class Home extends Component {
constructor(props) {
super(props);
this.state = {}
@johnantoni
johnantoni / format_date.swift
Created July 25, 2016 17:51
Swift ~ format NSDate to String
//: Playground - noun: a place where people can play
import Foundation
import Cocoa
extension NSDate {
func toS(let format:String) -> String? {
let formatter:NSDateFormatter = NSDateFormatter()
formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")
formatter.timeZone = NSTimeZone()