Skip to content

Instantly share code, notes, and snippets.

View saturngod's full-sized avatar
🎯
Focusing

Htain Lin Shwe saturngod

🎯
Focusing
View GitHub Profile
//Passing Attribute with jquery 1.4
jQuery('<a/>', {
id: 'foo',
href: 'http://google.com',
title: 'Become a Googler',
rel: 'external',
text: 'Go to Google!'
});
jQuery('<div/>', {
<?php
//download from http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz
//include_once 'fbconnect/config.php'; //has $api_key and $secret defined.
include_once 'facebook/facebook.php';
//global $api_key,$secret;
$appapikey = '';
$appsecret = '';
//Start Facebook
$fb=new Facebook($appapikey,$appsecret);
$fb_user=$fb->get_loggedin_user();
@saturngod
saturngod / spellcheck.php
Created March 28, 2011 03:56
google spell check api
<?php
header("Content-Type: text/xml; charset=utf-8");
$url="https://www.google.com/tbproxy/spell?lang=en";
$text = urldecode("mystary");
$body = '<!--?xml version="1.0" encoding="utf-8" ?-->';
<html>
<head>
<title>Sample Ajax</title>
<script src="http://code.jquery.com/jquery-1.5.2.min.js" ></script>
<script>
$(document).ready(function(){
$("#ajaxtest").click(function(){
var data = [];
@saturngod
saturngod / androidoffline.html
Created April 5, 2011 14:00
Offline link for android
<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-size: small;"><b>Update :- Honeycomb (3.0) and Latest Gingerbread (2.3.3) links updated</b></span><br>
<br>
<br>
<h1>How to install Android SDK without internet connection ? </h1><br>
I searched all over the internet and found no posts like this, hence I'm making one hoping it would be helpful for a lot of people.<br>
<br>
<b>The magic URL is </b>- <a href="http://dl-ssl.google.com/android/repository/repository.xml">http://dl-ssl.google.com/android/repository/repository.xml</a><br>
That is the XML file from which the URL for downloading the SDK packages are obtained.<br>
<br>
For e.g. if you want to download Mac version of Android SDK for version 2.0, you could look up that XML file. You will find a block under tag SDK 2.0 like this<br>
@saturngod
saturngod / checkbox.html
Created April 6, 2011 02:48
check box with form for php
<html>
<head>
<title>checkbox</title>
</head>
<body>
<form action="test.php" method="post">
<input type="checkbox" name="chk[]" value="1"/>Check1<br/>
<input type="checkbox" name="chk[]" value="2"/>Check1<br/>
<input type="checkbox" name="chk[]" value="3"/>Check1<br/>
<input type="submit" value="Submit"/>
@saturngod
saturngod / apc_store.php
Created April 18, 2011 04:12
php apc with sql
<?php
$sql="select * from `prize`";
if (apc_exists($sql)) {
print_r( apc_fetch($sql) );
}
else {
$result=mysql_query($sql);
while ($row = mysql_fetch_assoc($user_result)) {
<?php
//after insert or delete or update
$sql="select * from `prize`";
apc_delete($sql);
?>
@saturngod
saturngod / plist2json.py
Created April 24, 2011 09:24
Plist to Json
import json
from plistlib import readPlist
import StringIO
plist = open("source.plist","r").read()
in_file = StringIO.StringIO(plist)
plist_dict = readPlist(in_file)
open("source.json","w").write(json.dumps(plist_dict))
@saturngod
saturngod / mediaqueries.css
Created May 12, 2011 15:35
Media queries
@media screen and (max-width:480px){
#content {
width:470px;
}
}
@media screen and (max-width:320px){