Skip to content

Instantly share code, notes, and snippets.

View greenido's full-sized avatar
🏃‍♂️
Running with a big smile

Ido Green greenido

🏃‍♂️
Running with a big smile
View GitHub Profile
@greenido
greenido / ad-skin
Created August 9, 2010 23:12
JS to put an 'Ad skin' on a site
/**
* Code to fetch Ads from amazonS3 and put them in the 'sides' of the site (=skin).
* @author Ido
* @date 8/5/2010
*
* Make sure to change: ad-1 and ad-2 to nice urls
*/
$(document).ready(function(){
if($(window).width()>1280){
var b={
@greenido
greenido / short-sweet-img-cutter.php
Created February 11, 2011 05:04
Simple script to cut image into X (=4 in our case) smaller ones
<?php
$newImages = array();
list($width, $height, $type, $attr) = getimagesize('app.png');
$source = imagecreatefrompng('app.png');
$calWidth = $width / 4;
$calHeight = $height / 4;
for ($i = 0; $i < $width; $i += $calWidth) {
@greenido
greenido / GenUtils.php
Created February 11, 2011 18:43
Simple/General stuff to any php (finance) project
<?php
/**
* Simple Gen Util file to 'finance' php projects
* @author: Ido Green
* @date: 10/1/2008
*/
// Good start - with 'knowing' most of the balagan...
error_reporting(E_ALL);
ini_set('display_errors', '1');
@greenido
greenido / HGM API with xPath usage example
Created March 11, 2011 06:33
How To Deal With High Gear Media API Using PHP & XPath
<?php
/**
* @author Ido Green
* @since 04/10/2010
* @abstract Simple example how to fetch High Gear Media Full API using xPath
* @see http://greenido.wordpress.com/2010/04/15/how-to-deal-with-high-gear-media-api-using-xpath/
* @copyright HighGearMedia INC. 2010
*/error_reporting(E_ALL); // Always good to have it in development mode
$feed = new DOMDocument();
$feed->load('http://www.thecarconnection.com/api?uid=YourApiUserKey&cat=bottom-line');
@greenido
greenido / jQueryMobileTemplate-1.js
Created March 22, 2011 22:58
jQuery Mobile start up template page to kick your app quickly
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>XXX</title>
<!-- CSS -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<link rel="apple-touch-icon" href="images/XXX.png"/>
<link rel="apple-touch-startup-image" href="images/XXX-home-screen.png" />
@greenido
greenido / cars4me.html
Created March 22, 2011 23:05
This application give you personalized, recommendations for cars based on your twitter user (using Hunch + High Gear Media APIs)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Cars For Me</title>
<!-- CSS -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<link rel="apple-touch-icon" href="images/car1.png"/>
<link rel="apple-touch-startup-image" href="images/car-home-screen.png" />
@greenido
greenido / Rank your book collection
Created April 26, 2011 02:46
read a list of books (from a collection on your hard drive) and use amazon review to rank them. This is helpful if you have lots of books. It's good to put the best one on your kindle.
<?php
/**
* Description: read a list of books (from a collection on your hard drive)
* and use amazon review to rank them. This is helpful if you have (like me) more then 1,000 books.
* It's good to put the best one on your kindle.
*
* @author Ido Green
* @date 4/24/2011
* @see http://greenido.wordpress.com/
@greenido
greenido / httparchive-SearchSites.html
Created April 28, 2011 04:32
httparchive - Simple auto complete box to get sites urls.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Search Site</title>
<meta name="author" content="Ido Green" />
<meta name="description" content="http archive autocomplete box for site search" />
<meta name="copyright" content="GPL ?" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
@greenido
greenido / httparchive-fetchSites.php
Created April 28, 2011 04:34
Simple fetcher of sites' name base on the input from the auto-complete box.
<?php
/**
* Simple fetcher of sites' name base on the input from the auto-complete box.
* @author Ido Green
* @date 4/27/2011
*
* Change log:
5/3/2011
1. Improved version that limit the number of urls we are returning to the user.
2. Simple protection against SQL injection.
@greenido
greenido / fileBrowserHandler.htm
Created May 18, 2011 22:47
Simple test to FileSystem APIs (HTML5)
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Chrome File API tester</title>
<script>
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;