Skip to content

Instantly share code, notes, and snippets.

View johnantoni's full-sized avatar

John Griffiths johnantoni

View GitHub Profile
@johnantoni
johnantoni / mysql.txt
Created August 7, 2012 18:57
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@johnantoni
johnantoni / supersleight.plugin.js
Created April 14, 2011 08:20
Supersleight jQuery Plugin for Transparent PNGs in IE6
jQuery.fn.supersleight = function(settings) {
settings = jQuery.extend({
imgs: true,
backgrounds: true,
shim: 'x.gif',
apply_positioning: true
}, settings);
return this.each(function(){
if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {
<!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 / schema.xml
Last active October 16, 2018 18:09
sunspot solr on a linode vps
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@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 / unique.rb
Created October 2, 2012 20:05
Implement an algorithm using Ruby to determine if a string has all unique characters.
good = "abcdef"
bad = "abc abc"
def test_for_uniqueness(str)
# get array of characters, sort them
arr = str.chars.to_a.sort
last_char = nil # previous value
# now go thru each element of the array, if one matches the next then you have a winner
@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 }}
@johnantoni
johnantoni / gmail catchall
Created June 14, 2013 01:25
Gmail CatchAll
There is another way to create a catch-all address that will work for secondary domains. The steps are these:
1- Log into google.com/a/domain.com.
2- Click on the 'Google Apps' icon.
3- Click on 'Gmail.'
4- Click on 'Advanced settings.'
5- You will see different tabs, click on 'Default routing.'
6- Click on 'Add setting.'
7- On the new window under step 1 select 'Pattern match.'
8- Under 'Regexp' type in '.+@domain.co'