Skip to content

Instantly share code, notes, and snippets.

@mhofman
mhofman / get_lutron_cert.sh
Created October 13, 2017 09:48
Generate a signed certificate valid to connect locally to a Lutron Caseta Smart Bridge
#!/bin/sh
# Usage: get_lutron_cert.sh [bridge_ip] | tee cert.pem
function error() {
echo "Error: $1" >&2
exit 1
}
login_server="device-login.lutron.com"
@jckimble
jckimble / imageFilter.php
Created July 7, 2017 07:14
Checking if image is same image
<?php
function getImageHash($filename){
$content=file_get_contents($filename);
if($content){
list($width,$height,$type,$attr)=getimagesize($filename);
$im=imagecreatefromstring($content);
$new=imagecreatetruecolor($width,$height);
imagecopy($new,$im,0,0,0,0,$width,$height,$width,$height);
imagedestroy($im);
ob_start();
# Author: spoonsearch
# Feel free to share and modify, and tag me in the modified version on devRant.
# Happy Ranting
$the_cow = <<EOC;
$thoughts
$thoughts
`..--:::::::::::--..` .
`.- :-.`
.- -.
Row Season No. in series Company Deal Industry Entrepreneur Gender Amount Equity Valuation Corcoran Cuban Greiner Herjavec John O'Leary Harrington Guest # Sharks $ per shark Details / Notes
2 1 1 Ava the Elephant Yes Healthcare Female $50,000 55% $90,909 1 1 $50,000
3 1 1 Mr. Tod's Pie Factory Yes Food and Beverage Male $460,000 50% $920,000 1 1 2 $230,000
4 1 1 Wispots No Business Services Male 0
5 1 1 College Foxes Packing Boxes No Lifestyle / Home Male 0
6 1 1 Ionic Ear No Uncertain / Other Male 0
7 1 2 A Perfect Pear Yes Food and Beverage Female $500,000 50% $1,000,000 1 1 2 $250,000
8 1 2 Classroom Jams Yes Children / Education Male $250,000 10% $2,500,000 1 1 1 1 1 5 $50,000
9 1 2 Lifebelt No Consumer Products Male 0
@kwent
kwent / backup_neo4j_to_s3.sh
Last active November 27, 2019 05:38
NEO4J Backup to AWS S3 Shell Script
#!/bin/sh -
#title :backup_neo4j_to_s3.sh
#description :This script is creating a NEO4J Backup through neo4j-backup tool,
# compress the backup folder via LZMA2 algorithm compression, and upload it to AWS S3.
#author :Quentin Rousseau <contact@quent.in>
#date :2014-07-28
#version :1.1
#usage :sh backup_neo4j_to_s3.sh ip port destination | eg. sh backup_neo4j_to_s3.sh 127.0.0.1 6362 /mnt/datadisk/backup
#dependencies :apt-get update && apt-get install p7zip-full && apt-get install awscli.
#==============================================================================
@kosso
kosso / MediaModule.m
Created January 18, 2014 05:45
Titanium SDK experimental hack to enable picking animated gifs from the camera roll. Provides 'event.gifmedia' in the success event. (Look for the 'kosso' comments)
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_MEDIA
#import "MediaModule.h"
#import "TiUtils.h"
@mncaudill
mncaudill / similar.php
Created October 31, 2011 05:33
PHP version of simple image similarity algorithm
<?php
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
$filename = 'image.jpg';
list($width, $height) = getimagesize($filename);
$img = imagecreatefromjpeg($filename);
$new_img = imagecreatetruecolor(8, 8);