Skip to content

Instantly share code, notes, and snippets.

<form id="dl_form" action="/d/linkgen" method="POST">
<input id="dl_link" name="m_link" type="text" placeholder="Paste a link and click 'Generate'!">
<button type="submit" name="generate" id="dl_gen_btn" value="submit">Generate</button>
</form>
@Anan5a
Anan5a / captcha.php
Created March 15, 2018 05:48
Super Simple Captcha script
<?php
/*
*
*Author github.com/Anan5a
*Description Simple Captcha generator script
*/
//require_once './Fnc.php'; //application specific
define('CODESTR','012ABC3456789DEFGHIJKLMNOPQRSTUVWXYZ');
CREATE TABLE IF NOT EXISTS link(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(80) NOT NULL,
links TEXT NOT NULL,
password VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id)
);
CREATE TABLE IF NOT EXISTS link(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(80) NOT NULL,
links TEXT NOT NULL,
password VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id)
);
CREATE TABLE IF NOT EXISTS link(
'id' INT NOT NULL AUTO_INCREMENT,
'title' VARCHAR(80) NOT NULL,
'links' TEXT NOT NULL,
'password' VARCHAR(255),
'created_at' TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id)
);
@Anan5a
Anan5a / test2.php
Created February 23, 2018 12:01
Test Server Compatibility Rev 2
<?php
echo "Server Test :".PHP_EOL; echo "PHP version :".phpversion().PHP_EOL; try{ $db = new PDO("mysql:host=localhost;dbname=mlsbdcom_link1234",'mlsbdcom_link1234','EJxnPML7uor1'); echo "DB(L) ---> OK".PHP_EOL; }catch(PDOException $e){ throw new Exception("DB(L) ---> Error ::".$e->getMessage()); echo PHP_EOL; }
echo "Server software ---> ". $_SERVER['SERVER_SOFTWARE'].PHP_EOL; echo "Loaded Extensions : ".PHP_EOL; echo "<pre>"; foreach (get_loaded_extensions() as $x) { echo $x.PHP_EOL; } echo "</pre>";
<?php
//test method
public function test_store_should_save_new_books_in_database()
{
$this->post('/books',[
'title'=>'A story of rush',
'description'=>'A story of rush is a book of imagination. There\'s no existence of the book in real world!',
'author'=>'H.G XYZ',
'isbn'=>'16372916273',
'created_at'=>time(),
@Anan5a
Anan5a / php-cronjob-setter.php
Last active November 7, 2017 03:16
Example of how to manage cron using PHP Rev #2
<?php
/*
Copyright 2017 Ananta
This is an example script of how to manage crontab using PHP
Yeah it's a messy script but it works :p
* Create the crontab.tmp.txt file first to use it. This script is unable to populate the file when running using a webserver like apache or nginx
*/
$user = exec('whoami');
$lastCrontab =shell_exec('crontab -u '.$user.' -l');
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" ------Plugins-------
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-surround'
@Anan5a
Anan5a / atom-armv7l-build.log
Created May 15, 2017 06:21
Building log for Atom.io for arm platform
root@localhost:~/atom-armv7l# node script/build --create-debian-package
Node: v6.10.3
Npm: v3.10.5
Installing script dependencies
Installing apm
Installing modules ✓
Wrote Dependencies Fingerprint: /root/atom-armv7l/node_modules/.dependencies-fingerprint 5bc2c992a1656fa7ffc63ec4b6e9b442aa564696
Cleaning /root/atom-armv7l/out
Copying assets to /root/atom-armv7l/out/app
Transpiling Babel paths in /root/atom-armv7l/out/app