Skip to content

Instantly share code, notes, and snippets.

View jonesiscoding's full-sized avatar

AMJones jonesiscoding

View GitHub Profile
@jonfalcon
jonfalcon / object-keys-polyfill.js
Created February 5, 2013 15:54
Javascript: Object keys polyfill
/**
* Polyfill for Object.keys
*
* @see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys
*/
if (!Object.keys) {
Object.keys = (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
@NeoCat
NeoCat / honeywell_set_temp.sh
Last active August 17, 2024 15:14
Set temperature of honeywell Wi-Fi thermostat by shell script
#!/bin/bash
# Usage: ./honeywell_settmp.sh [-c|-h|-o] [<temp(F)>|schedule]
# Example: ./honeywell_settmp.sh -h 72 # set HEAT: temp=72F
# ./honeywell_settmp.sh -c schedule # set COOL: follow shceduled temp
# ./honeywell_settmp.sh -o # turn system OFF
######## Settings ########
LOGIN="YOUR_MAIL_ADDRESS"
PASSWORD="YOUR_PASSWORD"
@BlakeTurner
BlakeTurner / to-markdown.php
Created June 20, 2013 20:25
Convert HTML to Markdown in PHP. Great for migrating away from terrifying wysiwyg code.
<?php
/*
* to-markdown - an HTML to Markdown converter for PHP
*
* Copyright 2013, Blake Turner
* Licenced under the MIT licence
*
*/
@cmackay
cmackay / gist:5863257
Last active April 28, 2025 13:41
AppleScript to save and restore window position and sizes.
-- allSettings is a list of records containing {width:? height:? apps:{{name:? pos:? size:?},...}
-- for each display setup store the apps and their associated position and size
property allSettings : {}
-- create a variable for the current settings
set currentSettings to {}
display dialog "Restore or save window settings?" buttons {"Restore", "Save"} default button "Restore"
set dialogResult to result
@fabiofl
fabiofl / gist:5873100
Created June 27, 2013 00:41
Clear Mac OS X's icon cache.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@arunoda
arunoda / gist:7790979
Last active February 23, 2026 14:28
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@WickyNilliams
WickyNilliams / index.html
Last active March 26, 2025 13:05
parseTable.js - convert HTML table to array of objects. MIT licensed (https://opensource.org/licenses/MIT)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>parseTable</title>
</head>
<body>
<table>
<thead>
<tr>
@davidhund
davidhund / feature-detect flexbox.js
Last active June 29, 2024 13:49
The simplest feature-detect for flexbox?
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@1pixelzz
1pixelzz / Map_Parks.csv
Created April 24, 2015 03:35
City Parks and Features
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 49 columns, instead of 17 in line 2.
name,address,type,acreage,features,shorelineOn,location,baseball,basketball,b-cycleStation,beach,boatLaunch,boatMooring,botanicalGardens,canoeKayakStorage,cricket,discGolf,dogOff-LeashPark,dogOn-LeashArea,drinkingFountain,fireplace,fishing,football,hiking,historicalFeature,horseshoeBocce,iceSkating,lacrosse,noneservableShelter,openField,parkingLot,pickleball,playground,pool,recreationCenter,reservableShelter,restroom,scenicOverlook,shoreline,skiTrail,sleddingHill,snowshoeing,soccer,softball,sprayPark,tennis,ultimateFrisbee,volleyball,id
Acewood Conservation Park,1402 Acewood Blvd.,Conservation,38.17,1,n/a,"(43.077622, -89.3032255)",FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,1,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,1122
Acewood Park,1402 Acewood Blvd.,Neighborhood,4.26,5,n/a,"(43.077622, -89.3032255)",FALSE,1,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALS