Skip to content

Instantly share code, notes, and snippets.

View kosso's full-sized avatar

Kosso kosso

View GitHub Profile
@kosso
kosso / LICENSE.txt
Created May 23, 2011 01:59 — forked from jed/LICENSE.txt
calculate # of ms/seconds/minutes/hours/days in the past
Copyright (c) 2011 Jed Schmidt, http://jed.is
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@kosso
kosso / gist:1059705
Created July 2, 2011 03:16
Google PlusBar..
/*
The code for the bookmarklet:
You create bookmarklets with a href javascript: links.
If you don't know how to do this, simply copy/paste one you might already have in your toolbar and
then edit the url properies with this long line below:
*/
javascript:(function(){var%20included%20=%20false,openbar%20=%20false,src%20=%20"http://YOUR_DOMAIN/YOUR_SCRIPT.JS";var%20isIncluded%20=%20(function(){var%20scripts%20=%20document.getElementsByTagName('script');for(var%20i=0;i<scripts.length;i++){if(scripts[i].src%20==%20src){bar_toggle();%20return%20true;}}return%20false;})();if(isIncluded){%20%20}else{if(included){return%20false;}included%20=%20true;var%20head%20=%20document.getElementsByTagName("head")[0]%20||%20document.documentElement,script%20=%20document.createElement("script");script.type%20=%20"text/javascript";script.async%20=%20true;script.src%20=%20src;head.insertBefore(%20script,%20head.firstChild%20);}})();
@kosso
kosso / slider.html
Created August 1, 2011 19:45
A very simple basic 'slider' bar in JavaScript and CSS
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#bar{
width:200px;
height:25px;
border:1px solid black;
position:relative;
@kosso
kosso / ContentqueryModule.java
Created August 17, 2011 19:14
An attempt at building a Titanium Android module to assist media intents ..
/**
com.kosso.contentquery
A Titanium Android module to try and get the actual path of a contenUri returned from a RECORD_SOUND_ACTION Intent Activity.
by Kosso. (so far! ;p )
**/
package com.kosso.contentquery;
@kosso
kosso / rec.js
Created August 17, 2011 19:16
Ti JS code to test the mediaquery module
// Kosso : 2012
// mediaquery module code is here : https://gist.github.com/1153138
var win = Ti.UI.currentWindow;
// const value grabbed from
// http://developer.android.com/reference/android/provider/MediaStore.Audio.Media.html#RECORD_SOUND_ACTION
var RECORD_SOUND_ACTION = "android.provider.MediaStore.RECORD_SOUND";
@kosso
kosso / MediaqueryModule.java
Created August 18, 2011 02:15
A Titanium module for Android to get the full path of an audio or video contentUri
/**
MediaQuery Module for Appclerator Titanium : Android
Author : Kosso
Date : August 18, 2011
Updated : August 07, 2012 - Fixes and changes for newer Ti SDK since this was written.
More info re changes/porting : https://wiki.appcelerator.org/display/guides/Android+Module+Porting+Guide+for+1.8.0.1
Description :
@kosso
kosso / background.html
Created March 2, 2012 13:40 — forked from mohamedmansour/background.html
Google Chrome Extension to upload a locally stored image to imgurl API service.
<!DOCTYPE html>
<html>
<head>
<script>
const API_KEY = 'SOME_KEY';
/**
* Use HTML5 Canvas to get the image data
* @param {HTMLImageElement} img An Image Tag
@kosso
kosso / uri.js
Created April 25, 2012 19:27 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@kosso
kosso / app.js
Created July 16, 2012 11:52
titanium tiws module example
// ****************************************************************************************************************
// ****************************************************************************************************************
// test value can be 'raw' | 'socket.io' | 'nowjs'
var test = 'raw',
// ****************************************************************************************************************
// ****************************************************************************************************************
// REMEMBER to change this with your data
@kosso
kosso / appnet_annotations.php
Created September 2, 2012 03:20
Adding annotations to an App.net post using PHP
<?php
// # Adding annotations to an App.net post using PHP
// Kosso - alpha.app.net/kosso
// Do what you like with it.
$ACCESS_TOKEN = 'BLahbLAHl1234BLAHBLAHBLAH';
$post_text = "Hello. This post has annotations";