Skip to content

Instantly share code, notes, and snippets.

View neo22s's full-sized avatar

Chema neo22s

View GitHub Profile
@neo22s
neo22s / crashsafari.com.html
Created January 26, 2016 20:26
Source code of crashsafari.com
<!DOCTYPE html>
<html>
<body>
<h1>What were you expecting?</h1>
<script>
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
@neo22s
neo22s / index.php
Created December 13, 2015 19:42
Paysbuy integration for php
<?
include 'paysbuy.php';
//config the gateway
//by default is FALSE, put this to true to test
paysbuy::$sandbox = TRUE;
//set your emails here if none written demo email will be used
//paysbuy::$email = 'your mail account here';
if ($_POST)
@neo22s
neo22s / Exception.php
Created November 19, 2015 16:51
PHP7 classes/Kohana/Kohana/Exception.php for KO 3.3.x
<?php defined('SYSPATH') OR die('No direct script access.');
/**
* Kohana exception class. Translates exceptions using the [I18n] class.
*
* @package Kohana
* @category Exceptions
* @author Kohana Team
* @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 15 columns, instead of 6 in line 6.
user_name,user_email,title,description,date,category,location,price,address,phone,website,image_1,image_2,image_3,image_4
chema garrido,[email protected],another great title,description allows bbcode aasdsa asdas ,2015-03-06 13:06:15,Home category,Location 1,0,,,,http://reoc.lo/images/2009/06/29/5/another-great-title_1.jpg,,,
chema garrido,[email protected],just random title here,description allows bbcode,2009-07-07 08:58:40,Home category,Location 1,300,street number,8848585,NULL,http://reoc.lo/images/2009/07/07/6/just-random-title-here_1.jpg?v=1425293890,,,
chema garrido,[email protected],Kamaleon,sadasdasd,2015-03-05 12:24:29,Home category,Location 1,0,street number,34646257596,http://open-classifieds.com,,,,
Chema,[email protected],dfsdfsdf ssdfsd ,dfdsfsdf,2015-03-05 12:47:52,Home category,Location 1,0,0,,,,,,
chema garrido,[email protected],just random title here,asdasdasd,2015-03-05 12:50:28,Home category,Location 1,0,0,,,,,,
testeo,[email protected],just random title here,asdasdasd,2015-03-05 12:50:51,
@neo22s
neo22s / .htaccess
Created September 11, 2015 10:37
.htaccess
# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
@neo22s
neo22s / security.php
Created July 31, 2015 16:56
License for noahs
<?php
function authenticate( $fromLogin=FALSE )
{
global $gorumuser, $gorumroll, $gorumauthlevel, $gorumrecognised;
global $autoLogout, $autoLogoutTime, $cookiePath, $testauth, $now;
global $dontSetLastClickTime, $includeGuestsInCurrentlyOnline;
@neo22s
neo22s / ipdetails.php
Created July 29, 2015 17:20
Get ip geo info using 3rd party API's
die(print_r(ip_details("8.8.8.8")));
function ip_details($ip)
{
//list of providers to return IP information for free
$providers = array( 'ipinfo' => array('url' => "http://ipinfo.io/{$ip}/json",
'country_code' => 'country',
'country' => 'country',
'city' => 'city',
'region' => 'region',
@neo22s
neo22s / export.php
Created July 23, 2015 16:12
export noahs database into a CSV file to import at Open Classifieds
<?
set_time_limit(0);
ini_set('memory_limit', '1024M');
include("initdirs.php");
include(NOAH_APP . "/config.php");
include(NOAH_APP . "/constants.php");
@neo22s
neo22s / backup.sh
Created July 20, 2015 11:30
FTP Backup for MySQL and Files
#################
# FTP Backup Script
# Backup for files and MySQL, uploads to FTP and deletes old files.
# [email protected]
# 2013-08-26
# GPLv3
#################
#################
@neo22s
neo22s / aws-backup.sh
Last active March 12, 2021 01:55
Backup for AWS, uploads to FTP and deletes old files.
#################
# FTP AWS Backup Script
# Backup for AWS, uploads to FTP and deletes old files.
# [email protected]
# You need to install AWS CLI read more here http://martinbuberl.com/blog/backup-amazon-s3-bucket-with-aws-cli/
# 2015-07-20
# GPLv3
#################