Skip to content

Instantly share code, notes, and snippets.

View vinay13's full-sized avatar
🎯
Focusing

Vinay Singh vinay13

🎯
Focusing
View GitHub Profile
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var img1 = loadImage('http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png', main);
var img2 = loadImage('http://introcs.cs.princeton.edu/java/31datatype/peppers.jpg', main);
var imagesLoaded = 0;
function main() {
imagesLoaded += 1;
$('dialog').hide()
$('.input').hide()
$(document).ready(function(){
$('#boton').click(function(){
$('dialog').show();
});
$('#exit').click(function(){
$('dialog').hide();
@vinay13
vinay13 / newphp.php
Last active September 23, 2015 14:46
<?php
/* include db.config.php */
include_once(‘includes/config.php’);
//@required_once();
// Get user id
$id = isset($_GET['id']) ? mysql_real_escape_string($_GET['id']) : “”;
if(empty($id)){
$reponse['user']=array();
<?php
/* include db.config.php */
include_once(‘db_config.php’);
// Get user id
$id = isset($_GET['id']) ? mysql_real_escape_string($_GET['id']) : “”;
if(empty($id)){
$data = array(“result” => 0, “message” => “Wrong user id Let ‘s try once again!”);
} else {
<?php
/* include db.config.php */
include_once(‘db_config.php’);
// Get user id
$id = isset($_GET['id']) ? mysql_real_escape_string($_GET['id']) : “”;
if(empty($id)){
$data = array(“result” => 0, “message” => “Wrong user id Let ‘s try once again!”);
} else {
@vinay13
vinay13 / upload.txt
Last active September 23, 2015 06:47
request.done(function(data) {
if(data.msg == "success"){
$("#file_name").val(data.file);
$("#file_path").val(data.url);
$("#uploadimage").submit();
}; }
});
$("#sobmit").click(function(){
//var slide_count = parseInt($("#slide_no").val());
//var call_post = 'id';//$('').val();
var call_post=$('#select').val();
//var call_data = '322';//$('').val();
var call_data=$('.input').val();
$.ajax({
url: 'post-category.php',
type: "POST",
{
"name": "web",
"active": true,
"events": [
"push",
"pull_request"
],
"config": {
"url": "http://example.com/webhook",
"content_type": "json"
<input id="input" type="text" />
<dialog open>
<input class="input" type="text" />
<select id="select" >
<option>select</option>
<option>ID</option>
<option>Title</option>
<option>URL</option>
</select>
$('dialog').hide()
$('.input').hide()
$(document).ready(function(){
$('#boton').click(function(){
$('dialog').show();
});