Skip to content

Instantly share code, notes, and snippets.

View meltingice's full-sized avatar

Ryan LeFevre meltingice

View GitHub Profile
function OsimoModal(options){
this.options = {
'width' : 500,
'height' : 400,
'modal' : true,
'draggable' : false,
'showClose' : true,
'styles' : {}
};
#!/usr/bin/php
<?
# some useful file paths to rememebr
define('NGINX_CONFIG_ROOT', "/etc/nginx/sites-enabled/");
if($_SERVER['argc'] <= 1) {
show_help_msg();
} else {
$new_domain = trim($_SERVER['argv'][1]);
@meltingice
meltingice / jsonpfu-example.js
Created October 19, 2010 04:21
An example of how JSONP-Fu works.
/*
* In order to include libraries, we need to know
* the absolute path to the jsonp-fu directory.
*
* BTW, jfu is a shortcut to jsonpfu that is defined
* as a part of the library.
*/
jfu.set_path('/path/to/jsonp-fu/');
/*
/*
* CamanJS image modification example
*/
Caman('path/to/image.jpg', '#canvas-id', function () {
this.brightness(20);
this.contrast(5);
this.saturation(-25);
this.hue(120);
this.colorize('#AF3D15', 30);
});
@meltingice
meltingice / usernode.php
Created November 15, 2010 03:15
Social graph functions implemented using Redis.
<?
/*
* This example would probably work best if you're using
* an MVC framework, but it can be used standalone as well.
*
* This example also assumes you are using Predis, the excellent
* PHP Redis library available here:
* https://github.com/nrk/predis
*/
<!-- Place in your the <head> of your page -->
<script src='https://githubanywhere.appspot.com/github-anywhere.js'></script>
<script>
GitHubAnywhere(function() {
// use `this` instead of passing the object?
this.buttons();
});
</script>
<!-- Place anywhere on your page replaceing :name with a GitHub username and :repo with a repository name. -->
@meltingice
meltingice / gist:854220
Created March 4, 2011 05:23
Top 50 photos on TwitPic
short_id | views
----------------------
1NOZY | 6046885
1LRVYZ | 5500375
402GUX | 4774205
3VT0AX | 4014450
39P29E | 3621020
2TQFKV | 3075355
I98R2 | 1782350
3XS45P | 1749605
@meltingice
meltingice / gist:875484
Created March 18, 2011 01:43
What I wish JS could do.
function render() {
var pixels = get_pixels();
new Thread(function () {
for (i = 0, len = pixels.length; i < len; i +=4) {
// holy shared process memory batman!
// manipulate pixels here
}
finished();
});
@meltingice
meltingice / css3.less
Created April 28, 2011 18:48
CSS3 LESS Mini-Library
.background-gradient(@start, @stop) {
background-image:-moz-linear-gradient(top, @start, @stop);
background-image:-o-linear-gradient(top, @start, @stop);
background-image:-webkit-gradient(linear, lefttop, leftbottom, color-stop(0, @start), color-stop(1, @stop));
background-image:-webkit-linear-gradient(@start, @stop);
background-image:linear-gradient(top, @start, @stop);
filter: e("progid:DXImageTransform.Microsoft.gradient(startColorStr='") @start e("',EndColorStr='") @stop e("')");
}
.transition(@element, @duration, @easing) {
@meltingice
meltingice / uniqid.coffee
Created May 5, 2011 04:04
Minimal unique ID generator written in Coffeescript
uniqid = (->
id = 0
{ get: -> id++ }
)()
uniqid.get() #= 0
uniqid.get() #= 1
uniqid.get() #= 2, and so on...