var LazyImageLoader = (function(){ | |
var threshold = 150; | |
var isInitialized = false; | |
var tid = null; | |
var isFirst = true; | |
var loadImagesInHere = function(){ | |
var images = daum.$$("img:not([src])"); | |
var minY = daum.Browser.getScrollOffsets().top; | |
var maxY = minY + ( window.innerHeight || 800 ); |
# Easier navigation: .., ..., ~ and - | |
alias ..="cd .." | |
alias cd..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
alias ~="cd ~" # `cd` is probably faster to type though | |
alias -- -="cd -" | |
# Detect which `ls` flavor is in use |
#데이타가 쌓이는 디렉토리가 /data1/crawl_data 라면 아래 스크립트는 최근 300 개만 남기고 파일을 지운다. | |
#!/bin/bash | |
DATE=`date +'%Y%m%d_%H%m%S'` ## 로그 기록을 위해 작업시간을 기록한다. | |
BACKUPCOUNT=300 ## 최근 300 개만 남기고 지운다. | |
WORKDIR=/data1/crawl_data | |
dirlist=`/bin/ls -t $WORKDIR` | |
i=1; | |
for fd in $dirlist; do |
// Given a query string "?to=email&why=because&first=John&Last=smith" | |
// getUrlVar("to") will return "email" | |
// getUrlVar("last") will return "smith" | |
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/ | |
function getUrlVar(key){ | |
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); | |
return result && unescape(result[1]) || ""; | |
} |
/** | |
* This jQuery plugin resizes a textarea to adapt it automatically to the content. | |
* @author Amaury Carrade | |
* @version 1.1 | |
* | |
* @example $('textarea').autoResize({ | |
* animate: { // @see .animate() | |
* enabled: true, // Default: false | |
* duration: 'fast', // Default: 100 | |
* complete: function() {}, // Default: null |
// define UIColor macro | |
#define UIColorRGBMake(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] | |
// iOS version check macro | |
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
#!/bin/sh | |
export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer" | |
SYMBOLICATECRASH=`find /Applications/Xcode.app -name symbolicatecrash -type f` | |
${SYMBOLICATECRASH} -v "$1" |
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.