Skip to content

Instantly share code, notes, and snippets.

View mycomputerak47's full-sized avatar

mycomputerak47

View GitHub Profile
@mycomputerak47
mycomputerak47 / insert.html
Created July 7, 2016 16:30
example to insert query in sqlite phonegap
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title><meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="css/w3.css" />
<link rel="stylesheet" type="text/css" href="css/w3-theme.css" />
<link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.css" />
  <script type="text/javascript" charset="utf-8" src="js/jquery-3.0.0.min.js"></script>
@mycomputerak47
mycomputerak47 / crawler.php
Created June 14, 2016 19:10
this is a php file made to crawl links from a website. Just an experiment !
<?php
$to_crawl = "http://kecl.af";//just a random URL
$c = array();
function get_links($url){
global $c;
$input = @file_get_contents($url);
$regex = "<a\s[^>]*href=(\"??)([^\">]*?)\\1[^>]*>(.*)<\/a>";
preg_match_all("/$regex/siU",$input,$matches);
$base_url = parse_url($url,PHP_URL_HOST);
//echo $base_url;
<script>(function($) {
var url = 'http://divakarparashar.hol.es/innovation/mobile/protected/json/news.json';
$.ajax({
type: 'GET',
url: url,
async: false,
jsonpCallback: 'MyJSONPCallback',
contentType: "application/json",
dataType: 'jsonp',
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="<?php print($_SERVER['PHP_SELF'].'/../bootstrap/css/bootstrap.min.css')?>">
<script src="<?php print 'file://'.dirname(__FILE__).'/../bootstrap/js/bootstrap.min.js'?>"></script>
<script src="<?php echo $_SERVER['PHP_SELF'].'/../js/jquery.min.js'?>"></script>
<link rel="stylesheet" type="text/css" href="<?php print($_SERVER['PHP_SELF'].'/../css/header_style.css')?>">
</head>
@mycomputerak47
mycomputerak47 / ajax.js
Last active February 28, 2016 18:57
sending form using ajax
$(document).ready({
$("#msg_form").submit(function(){
var msg_auth = $( "input[name='msg_author']" ).val();
var msg_info = $( "input[name='msg_info']" ).val();
var msg_msg = $( "input[name='msg_msg']" ).val();
$.ajax({
type:"get",
url:"php/send_message.php",
data:"p_msg_auth="+msg_auth+"&p_msg_info="+msg_info+"&p_msg_msg="+msg_msg,
beforeSend:function(){$("#send_btn").val('sending...');},