Skip to content

Instantly share code, notes, and snippets.

View slick2's full-sized avatar
🏠
Working from home

Carey slick2

🏠
Working from home
View GitHub Profile
@slick2
slick2 / bad_ip.txt
Last active November 8, 2023 13:50
Traffic Jammer Report
https://wordpress.org/plugins/traffic-jammer/
178.62.113.151,
80.76.51.210,
193.201.9.202,
45.227.254.22,
81.19.135.24,
5.78.50.22,
54.213.127.163,
78.142.18.92,
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="frm">
<form action="process.php" method="POST">
<p>
<?php
/* pconnect for newbies */
mysql_pconnect('localhost', 'root', '')
or die(mysql_error());
mysql_select_db('mooddatabase')
or die(mysql_error());
?>
var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
if(iOS == true){
var test = getQueryVariable('test');
if(test == '123'){
document.write('Hello World');
}
}
function getQueryVariable(variable)
$.ajax({
url: '/users/xhr_contactlist',
dataType: 'json'
}).done(function (data) {
console.log(data);
});
@slick2
slick2 / Users.php
Last active August 3, 2017 13:20
sample ajax method
class Users{
public function xhr_contactList(){
//make a curl call
$url = https://www.namesilo.com/api/contactList?version=1&type=json&key=12345
//response
$result = $this->_http_get($url);
$return = json_decode($result);
SET SQL_SAFE_UPDATES = 0;
SET @my_id = 4;
SELECT l.*, u.*
FROM user u INNER JOIN login l ON u.login_id = l.id
WHERE l.id = @my_id;
DELETE FROM user where login_id = @my_id;
DELETE FROM login WHERE id = @my_id;
DELETE FROM user_links WHERE login_id = @my_id;
SELECT l.*, u.*
FROM user u INNER JOIN login l ON u.login_id = l.id
function refreshCaptcha()
{
var img = document.images['captchaimg'];
/** this is the wrong code, since the img src of captcha is changed this should changed also **/
img.src = img.src.substring(0, img.src.lastIndexOf("?")) + "?rand=" + Math.random() * 1000;
}
@slick2
slick2 / inheritance.js
Created February 28, 2015 11:04
Javascript Inherit
var unitcircle = function(){
this.r = 1;
};
var c = new unitcircle();
c.x = 1;
c.y = 1;
console.log(c);
@slick2
slick2 / gist:f399676606e21355ddab
Created February 14, 2015 16:37
Traditional Long Poll
(function poll() {
setTimeout(function() {
$.ajax({
url: '/magento_ajax_import_status',
type: 'GET',
success: function(data) {
obj.setValue(data.value);
},
dataType: "json", complete: poll }
);