I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
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
component | |
output = false | |
hint = "I provide automatic retry functionality around the target component." | |
{ | |
/** | |
* I initialize the retry proxy with the given target component. Retries will | |
* only be applied to "transient" errors. And, since the proxy doesn't know which | |
* errors are transient / retriable, it must check with the isTransientError() | |
* function. |
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 | |
$conn = Database::connection(); | |
$qb = $conn->createQueryBuilder(); | |
$qb->select('*') | |
->from('DownloadStatistics') | |
->orderBy('timestamp', 'ASC'); | |
if ($startdate = $_GET['startdate']) { | |
$qb->andWhere( |
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
#!/bin/bash | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
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
<cffunction | |
name="truthy" | |
access="public" | |
returntype="boolean" | |
output="false" | |
hint="I determine if the given argument can be converted / shoe-horned into a boolean value. By default, we will be trying to create a FALSE; everything else will be TRUE."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="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
# remove | |
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist | |
# restore | |
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist |
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
/* | |
* jQuery Double Tap | |
* Developer: Sergey Margaritov (github.com/attenzione) | |
* License: MIT | |
* Date: 22.10.2013 | |
* Based on jquery documentation http://learn.jquery.com/events/event-extensions/ | |
*/ | |
(function($){ |
How many different ways can you slice an apple touch icon? At least 7.
<!-- iPhone, iPod Touch, older Android devices (57×57) -->
<link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed">
<!-- iPad, iPad Mini (72×72) -->
<link href="/apple-touch-icon-72x72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72">
The BBC has a server-side image service which provides developers with multiple sized versions of any image they request. It works in a similar fashion to http://placehold.it/ but it also handles the image ratios returned (where as placehold.it doesn't).
The original BBC News process (and my re-working of the script) follows roughly these steps...
- Create new instance of ImageEnhancer
- Change any
div
s within the page (which have a class ofdelayed-image-load
) into a transparent GIF using a Base64 encoded string.- We set the
width
&height
HTML attributes of the image to the required size - We know what size the image needs to be because each
div
has customdata-attr
set server-side to the size of the image - We then set a class of
image-replace
onto each newly created transparent image
- We set the
- We use a 250ms
setTimeout
to unblock the UI thread and which calls a functionresizeImages
which enhances theimage-replace
images so their source is now set to a URL whe
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
// Based on Adobe Community Forums member BlipAdobe's script: | |
// http://forums.adobe.com/message/3908198#3908198 | |
#target photoshop | |
// Constants | |
var QUANTIZE_PIXELS = 1; // The number of whole pixels we wish the path points to be quantized to | |
var PIXEL_RATIO = app.activeDocument.resolution / 72; // Standardize pixels and points | |
// Some helpers |
NewerOlder