Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>RISE-Multipurpose Html Template</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
$(document).ready(function(){
//ajax form
$('#submit').click(function(e){
e.preventDefault();
$(this).text('Sending...');
//$(this).prop('disabled',false);
console.log('Clicked');
var
fname=$('#fname').val(),
$(document).ready(function(){
function loadjson(url,lang,next){
var j;
if(next<=0||next=='undefined'){
next='null';
}
$.ajax({
url:url,
type:'POST',
data:{lang:lang,next:next},
@Anan5a
Anan5a / google-recaptcha-verifier.php
Last active November 29, 2016 13:08
A function to verify Google reCAPTCHA response.
<?php
$response=$_POST['g-recaptcha-response'];
$secret='your_secret_key';
$json=g_rec_verify($response,$secret);
/*
function
*/
@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
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 / 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');
<?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 / 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>";
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)
);