This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Original Source: http://darcyclarke.me/development/fix-jquerys-animate-to-allow-auto-values-2/ | |
* | |
* This is an addition to Darcy Clark's animateAuto function that allows you to animate a div with | |
* a set max-width/height growing to full height/width. In my use case, I had a div with a height | |
* larger than its default max-height. I wanted to animate the growth from the set max-height to the | |
* actual height. This addition to Darcy's function simply turns off the max-height/width and immediately | |
* sets the actual height of the div to the previous max-height/width. Then it animates to auto like normal. | |
* Also, the speed variable can optionally be a function of height or width or both. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Original Source: http://stackoverflow.com/questions/1318076/jquery-hasattr-checking-to-see-if-there-is-an-attribute-on-an-element | |
* | |
* jQuery add-on to check if an element has an attribute. | |
*/ | |
jQuery.fn.hasAttr = function(name) { | |
return typeof this.attr(name) === typeof undefined || this.attr(name) === false; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Original Source: http://www.gerbenjacobs.nl/push-new-value-into-array-with-php/ | |
*/ | |
function array_push_insert($array, $index, $value) { | |
if (array_key_exists($index, $array)) { | |
$firstArray = array_slice($array, 0, $index); | |
$lastArray = array_slice($array, $index); | |
array_push($firstArray, $value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After spending too much time away from Python on Javascript, I gave this a shot. To my surprise, it worked! | |
# Since Python doesn't bind "self" implicitly in classes, this looks pretty similar to Python classes. | |
# You want inheritance? Pass in the Parent "class" and copy the key/vals a la Javascript. | |
# Even adding dot syntax is not too tough. | |
def Cat(legs, colorId, name): | |
def sayHi(): | |
print 'Hi, my name is %s. I have %s legs and am %s.' % (this['name'], this['legs'], this['color']) | |
this = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This are a collection of examples for C 201. | |
* These combine concepts you may or may not be | |
* familiar with and are especially useful for | |
* students new to C. There is a lot of really | |
* cool stuff you can do in C without any cool | |
* languages. | |
* | |
* This is file in particular is an introduction | |
* to fun function usage in C. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open OWebl | |
open Response | |
open Rule | |
open Server | |
let handler = | |
Handler.create | |
(StaticRouteRule.create "/" [Verb.GET]) | |
(SimpleResponse.create "Hello World!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open OWebl | |
open Rule | |
open Server | |
open Mycustomresponse | |
let handler = | |
Handler.create | |
(StaticRouteRule.create "/" [Verb.GET]) | |
(MyCustomResponse.create "Hello World!" []) (*headers go here*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
{I have|I’ve} been {surfing|browsing} online more than {three|3|2|4} hours today, yet | |
I never found any interesting article like yours. {It’s|It is} | |
pretty worth enough for me. {In my opinion|Personally|In my view}, | |
if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.| | |
I {couldn’t|could not} {resist|refrain from} commenting. | |
{Very well|Perfectly|Well|Exceptionally well} written!| | |
{I will|I’ll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can’t} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. | |
Do {you have|you’ve} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may | |
just|may|could} subscribe. Thanks.| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app { | |
least_conn; | |
server localhost:9090; | |
} | |
server { | |
listen 80; | |
# Uncomment these if you want nginx to serve your static files. | |
#location ~ \.(png|jpeg|jpg|css|js|ico|ttf|woff) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
* Tested on PolyML. `polyc server.ml && ./a.out` | |
*) | |
fun println s = | |
(print (s ^ "\n"); TextIO.flushOut TextIO.stdOut) | |
fun readAll conn req = | |
let val ntoread = Socket.Ctl.getNREAD conn in | |
if ntoread > 0 |
OlderNewer