This file contains hidden or 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
// For Get | |
// set HTTP header | |
$headers = array( | |
'Content-Type: application/json', | |
); | |
// query string | |
$fields = array( | |
'key' => '<your_api_key>', |
This file contains hidden or 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
Here is the fix, more info here: | |
https://github.com/mxcl/homebrew/issues/5004 | |
First, stop the db, then | |
cd /var | |
rm -r pgsql_socket | |
ln -s /tmp pgsql_socket | |
chown _postgres:_postgres pgsql_socket |
This file contains hidden or 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
function post_to_url($url, $data) { | |
$fields = ''; | |
foreach($data as $key => $value) { | |
$fields .= $key . '=' . $value . '&'; | |
} | |
rtrim($fields, '&'); | |
$post = curl_init(); | |
curl_setopt($post, CURLOPT_URL, $url); |
This file contains hidden or 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
if (navigator.userAgent.indexOf("MSIE") > 0) { | |
if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { | |
window.opener = null; window.close(); | |
} | |
else { | |
window.open('', '_top'); window.top.close(); | |
} | |
} | |
else if (navigator.userAgent.indexOf("Firefox") > 0) { | |
window.location.href = 'about:blank '; |
This file contains hidden or 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
font-family: "wf_SegoeUILight","wf_SegoeUI","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe","Segoe WP","Tahoma","Verdana","Arial","sans-serif"; |
This file contains hidden or 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
app.directive('input', function() { | |
return { | |
require: '?ngModel', | |
restrict: 'E', | |
link: function($scope, $element, $attrs, ngModelController) { | |
var inputType = angular.lowercase($attrs.type); | |
if (!ngModelController || inputType === 'radio' || | |
inputType === 'checkbox') { | |
return; |
This file contains hidden or 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
void DeleteRecursive(File fileOrDirectory) { | |
if (fileOrDirectory.isDirectory()) | |
for (File child : fileOrDirectory.listFiles()) | |
DeleteRecursive(child); | |
fileOrDirectory.delete(); | |
} |
This file contains hidden or 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
private boolean unpackZip(String path, String zipname) | |
{ | |
InputStream is; | |
ZipInputStream zis; | |
try | |
{ | |
String filename; | |
is = new FileInputStream(path + zipname); | |
zis = new ZipInputStream(new BufferedInputStream(is)); | |
ZipEntry ze; |
NewerOlder