Skip to content

Instantly share code, notes, and snippets.

🎯
Busy working on React & iOS code

John Griffiths johnantoni

🎯
Busy working on React & iOS code
View GitHub Profile
View index.html
<!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 Feb 28, 2019
remove '-Broadband High' from videos
View rename-videos.sh
for i in *.mp4 ; do mv "$i" "${i/-Broadband High*.mp4/.mp4}" ; done
@johnantoni
johnantoni / instructions.md
Last active Aug 27, 2018 — forked from zentralwerkstatt/instructions.md
Install Syncthing on Raspberry Pi
View instructions.md
  • 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 Aug 11, 2018 — forked from mchirico/twotableviewsInOneView.swift
Creating multiple tableViews in one ViewController...this just starts out as a view controller
View twotableviewsInOneView.swift
//
// ViewController.swift
// Delete
//
// Created by Mike Chirico on 10/21/15.
// Copyright © 2015 Mike Chirico. All rights reserved.
//
import UIKit
View gist:d68a2f71ef05c133867927f3992ec56e
<Marker
position={{ lat: lat, lng: lng }}
onClick={this.onToggleOpen}
editable={true}
draggable={true}
>
{this.state.isOpen &&
<InfoBox
onCloseClick={this.onToggleOpen}
options={{ closeBoxURL: ``, enableEventPropagation: true }}
View drawingEditor notes
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
View es6-promise.js
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 Mar 14, 2018
react app.js
View 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 Jul 25, 2016
Swift ~ format NSDate to String
View format_date.swift
//: 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()
You can’t perform that action at this time.