Skip to content

Instantly share code, notes, and snippets.

View kas-cor's full-sized avatar
🏠
Working from home

Alexsander kas-cor

🏠
Working from home
  • kas-cor
  • World
View GitHub Profile
@kas-cor
kas-cor / cron_help
Last active August 29, 2015 14:18
Если panel не позволяет выставить точные настройки Cron
<?php
$flag_path = "/path/to/flag.txt";
$runUrl = "http://host.ru/run.php"; // Script to run
$runto = "wHi"; // week hours minuts
$time = "0180"; // Sunday, 18:00,01,02,03,04,05,06,07,08,09
for($i=0;$i<10;$i++) { $times[$time.$i] = "run"; }
if (!file_exists($flag_path) && !empty($times[date($runto)])) {
@kas-cor
kas-cor / TableHeadClone.html
Last active August 29, 2015 14:19
TableHeadClone
<!DOCTYPE html>
<html>
<head>
<title>Sample table head clone</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<table border="1" style="border-collapse: collapse" width="100%" cellspacing="1" class="headclone">
<tr align="center" bgcolor="#CCCCCC" class="headclone-1">
@kas-cor
kas-cor / virtualwifi.cmd
Last active May 30, 2016 07:01
Virtual AP Wi-Fi Windows 7, 8
@echo off
echo 1. Install & Start
echo 2. Start
echo 3. Status
echo 4. Stop
echo 5. Uninstall
set /P choice="Choice [3]: "
if "%choice%"=="1" GOTO install
if "%choice%"=="2" GOTO start
if "%choice%"=="4" GOTO stop
@kas-cor
kas-cor / RuCaptcha.js
Created June 15, 2015 12:27
RuCaptcha.com and html2canvas.hertzen.com
function rucaptcha(obj, callback) {
obj.ready(function () {
console.log("Capture captcha...");
obj.html2canvas({
allowTaint: true,
onrendered: function (canvas) {
var captcha = canvas.toDataURL("image/png");
console.log("Send to decode captcha...");
$.post("http://rucaptcha.com/in.php", "method=base64&key={API_KEY}&body=" + encodeURI(captcha), function (res) {
console.log(res);
@kas-cor
kas-cor / form.html
Last active October 6, 2015 09:16
Check form
<form action="server.php" method="POST" id="contact_form">
<input type="hidden" name="check_filelds" value="email,name,text" />
<input type="hidden" name="check_form" value="" />
<input type="text" name="email" value="" />
<input type="text" name="name" value="" />
<textarea name="text" rows="4" cols="20"></textarea>
<input type="button" name="send" value="send" onclick="checkAndSendForm($('#contact_form'))"/>
</form>
@kas-cor
kas-cor / .htaccess
Last active July 1, 2016 11:48
Redirect
Options All -ExecCGI -Indexes -Includes +FollowSymLinks
ErrorDocument 404 /error404.html
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^error404(.*).html$ /404.php?desc=$1 [L,QSA]
@kas-cor
kas-cor / find_replace.js
Created March 18, 2016 08:19 — forked from CrowderSoup/find_replace.js
Replace all instances of a substring without Regex in JavaScript
var str = 'This is a test string.';
// Let's replace all spaces with ','
str = str.split(' ').join(',');
@kas-cor
kas-cor / .htaccess
Last active December 9, 2016 06:50
Tricks
Options All -ExecCGI -Indexes -Includes +FollowSymLinks
# php_flag display_errors on
# 401-auth
AuthType Basic
AuthName "Thats protected Area!"
AuthUserFile /usr/host/mysite/.htpasswd # https://htmlweb.ru/service/htpasswd.php - generator
Require valid-user
RewriteEngine On
@kas-cor
kas-cor / DragDropFiles.html
Last active May 30, 2016 07:23
HTML5 Drag & Drop files
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Drag & Drop files</title>
<style>
.dragdrop {
border: 2px;
width: 100px;
height: 100px;
@kas-cor
kas-cor / Telegram.class.php
Last active August 11, 2016 06:28
Telegram sendMessage API
<?php
/**
* @author kas-cor <[email protected]>
* @link http://github.com/kas-cor repositories
*/
namespace cls;
class Telegram {