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
$(window).scroll(function(){ | |
var $window = $(this); | |
if($window.scrollTop() == $(document).height() - $window.height()) $('#more').click() | |
}); |
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
$.fn.closest_descendent = function(filter) { | |
var $found = $(), | |
$currentSet = this; // Current place | |
while ($currentSet.length) { | |
$found = $currentSet.filter(filter); | |
if ($found.length) break; // At least one match: break loop | |
// Get all children of the current set | |
$currentSet = $currentSet.children(); | |
} | |
return $found.first(); // Return first match of the collection |
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
Option Explicit | |
Public Function GetXmlData(url As String) As Object | |
'http://msdn.microsoft.com/ja-jp/library/aa468547.aspx | |
Dim dom As Object | |
Set dom = CreateObject("MSXML2.DOMDocument") | |
dom.async = False | |
'http://support.microsoft.com/kb/281142/ja |
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 | |
$_PUT = array(); | |
parse_str(file_get_contents('php://input'), $_PUT); | |
?> |
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 | |
add_filter( 'http_request_args', 'my_plugin_prevent_update_check', 10, 2 ); | |
function my_plugin_prevent_update_check( $r, $url ) { | |
if ( 0 === strpos( $url, 'http://api.wordpress.org/plugins/update-check/' ) ) { | |
$my_plugin = plugin_basename( __FILE__ ); | |
$plugins = unserialize( $r['body']['plugins'] ); | |
unset( $plugins->plugins[$my_plugin] ); | |
unset( $plugins->active[array_search( $my_plugin, $plugins->active )] ); | |
$r['body']['plugins'] = serialize( $plugins ); | |
} |
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
var FB = require('fb'); | |
FB.api('oauth/access_token', { | |
client_id: process.env.FACEBOOK_APP_ID, | |
client_secret: process.env.FACEBOOK_SECRET, | |
grant_type: 'client_credentials' | |
}, function(res) { | |
if (!res || res.error) { | |
console.log('error occurred when getting access token:', res && res.error); | |
return; |
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
var http = require("http"), | |
url = require("url"), | |
fs = require("fs"), | |
async = require("async"), | |
Instagram = require('instagram-node-lib'); | |
Instagram.set('client_id', /* client key */); | |
Instagram.set('client_secret', /* client secret */); | |
fetchTag('cat', 400); |