Skip to content

Instantly share code, notes, and snippets.

View jonkiddy's full-sized avatar
🏠
Coffee + Music - Interruptions = Code

Jon Kiddy jonkiddy

🏠
Coffee + Music - Interruptions = Code
View GitHub Profile
#!/usr/bin/env php
<?php
// lists netbeans projects and shows current branch for each
$user = get_current_user();
$dir = scandir("/Users/$user/NetBeansProjects");
foreach ($dir as $d) {
if (!in_array($d, ['.', '..']) && strpos($d, '-nb') == false) {
$data = shell_exec("cd /Users/$user/NetBeansProjects/$d && git status");
$lines = explode("\n", $data);
print_r(str_replace('On branch ', '', $lines[0]) . ' ' . $d);
@jonkiddy
jonkiddy / s3_butckets.php
Created July 11, 2015 18:40
Some example of dealing with objects in S3 buckets.
// https://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html#uploading-a-file
/**
* set key & secret
*/
$client = S3Client::factory(array(
'key' => ‘YOUR-KEY’,
'secret' => ‘YOUR-SECRET’
));
// vibrate can be 1, 2, 3
{"content":"Hello John,\nWelcome to Cards for Pebble!\n\nUpdated:\nSat, 30 May 2015 08:05:43 -0400","refresh_frequency":10,"vibrate":"1"}
@jonkiddy
jonkiddy / ec2startup.sh
Created April 29, 2015 17:39
EC2 Startup Shell Script
#!/bin/bash
# Simple setup.sh for configuring Ubuntu 12.04 LTS EC2 instance
# for headless setup.
# Install nvm: node-version manager
# https://github.com/creationix/nvm
sudo apt-get install -y git
sudo apt-get install -y curl
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
@jonkiddy
jonkiddy / gist:ac4a1477974e78fc1df4
Created February 24, 2015 19:55
jQuery-Mobile + Phonegap
// Correct way of using JQuery-Mobile/Phonegap together?
// the order of declaring script matters. First include jquery, THEN THIS CODE inside a script element, then jquery mobile js
var deviceReadyDeferred = $.Deferred();
var jqmReadyDeferred = $.Deferred();
document.addEventListener("deviceReady", deviceReady, false);
function deviceReady() {
---
aamu.edu: Alabama A&M University
ab.edu: Alderson Broaddus University
acu.edu: Abilene Christian University
adelphi.edu: Adelphi University
aic.edu: American International College
alaska.edu: University of Alaska System
alasu.edu: Alabama State University
albany.edu: University at Albany
albion.edu: Albion College
@jonkiddy
jonkiddy / table.md
Last active August 29, 2015 14:07
Table using markdown.
Header 1 Header 2
More data Some data
Random data Extra data
Associated data My data
Even more data Your data
@jonkiddy
jonkiddy / gist:e830ce2f525ba5169114
Created September 4, 2014 20:24
Controlling top bar in Phonegap app.
In MainViewController.m inside: - (void)viewWillAppear:(BOOL)animated add this:
//Lower screen 20px on ios 7
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect viewBounds = [self.webView bounds];
viewBounds.origin.y = 18;
viewBounds.size.height = viewBounds.size.height - 18;
self.webView.frame = viewBounds;
}
@jonkiddy
jonkiddy / Preferences.sublime-settings
Last active July 23, 2018 15:01
Sublime Text Preferences
keymap:
[
// Sublime
{ "keys": ["super+shift+i"], "command": "reindent" },
{ "keys": ["super+shift+o"], "command": "expand_tabs" },
{ "keys": ["command+shift+k"], "command": "toggle_side_bar" },
// PHP Companion
{ "keys": ["super+shift+u"], "command": "find_use" },
{ "keys": ["super+shift+n"], "command": "insert_php_constructor_property" },
@jonkiddy
jonkiddy / first_robotic_useful_links.html
Last active December 23, 2015 16:59
Useful FIRST Robotic Links