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
<article id="post-49" class="post-49 post type-post status-publish format-standard hentry category-news"> | |
<header class="entry-header"> | |
<img width="239" height="261" src="http://undo.im/koikid/wp-content/uploads/2014/03/pic5.png" class="attachment-post-thumbnail wp-post-image" alt="pic5" /> | |
<h1 class="entry-title"> | |
<a href="http://undo.im/koikid/%e6%b8%ac%e8%a9%a6post/" rel="bookmark"> | |
測試POST | |
</a> | |
</h1> | |
</header> |
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
// The .config() part is the relevant part, 'SomeModule' is arbitrary name, | |
// but this config() call goes on your main ng-app="YourAppModule" | |
// The PHP $_POST expects data w/ a form content type, not a JSON payload | |
angular.module("YourAppModule", ["SomeModule"]).config(function($httpProvider) { | |
$httpProvider.defaults.headers.put['Content-Type'] = | |
'application/x-www-form-urlencoded'; | |
$httpProvider.defaults.headers.post['Content-Type'] = | |
'application/x-www-form-urlencoded'; | |
}); |
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 serialize = function(obj, prefix) { | |
// http://stackoverflow.com/questions/1714786/querystring-encoding-of-a-javascript-object | |
var str = []; | |
for(var p in obj) { | |
var k = prefix ? prefix + "[" + p + "]" : p, v = obj[p]; | |
str.push(typeof v == "object" ? serialize(v, k) : encodeURIComponent(k) + "=" + encodeURIComponent(v)); | |
} | |
return str.join("&"); | |
} |
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 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 | |
$URL='http://us11.api.mailchimp.com/3.0/lists/LISTID/members'; | |
$data = array("email_address"=>"xxX@sample.com","status"=>"subscribed","merge_fields"=>array("FNAME"=>"江","LNAME"=>"小屁","MMERGE3"=>"江小屁")); | |
$data_string = json_encode($data); | |
$ch = curl_init($URL); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
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
$(document).ready(function() { | |
var slider = $('.bxslider').bxSlider({ | |
pager: false, | |
controls: false, | |
touchEnabled:false | |
}); | |
$('#go').click(function() { | |
slider.goToNextSlide(); | |
}); |
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('a').click(function(e){ | |
var url = jQuery(this).attr('href'); | |
if (!/^([javascript]|[mailto])/.test(url)){ | |
e.preventDefault(); | |
location=url+location.search+location.hash; | |
} | |
}); |
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
//1~4 | |
for (var i=1; i<5; ++i){ | |
$('#menu_'+i).click(function(){ | |
$('#tab_'+$(this).attr('id').split('_')[1]).trigger('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
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
* --- | |
* Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders. | |
**/ | |
var inputs = readline().split(' '); | |
var lightX = parseInt(inputs[0]); // the X position of the light of power | |
var lightY = parseInt(inputs[1]); // the Y position of the light of power |
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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <ifaddrs.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
int main (int argc, const char * argv[]) { | |
struct ifaddrs * ifAddrStruct=NULL; | |
struct ifaddrs * ifa=NULL; |
OlderNewer