Skip to content

Instantly share code, notes, and snippets.

View stavrossk's full-sized avatar
🎯
Focusing

Stavros Skamagkis stavrossk

🎯
Focusing
View GitHub Profile
@stavrossk
stavrossk / Import CSV file.php
Created May 1, 2014 07:18
Import a CSV file using PHP and MySQL.
<?php
//connect to the database
$connect = mysql_connect("localhost","username","password");
mysql_select_db("mydatabase",$connect); //select the table
//
if ($_FILES[csv][size] > 0)
@bkimminich
bkimminich / XXXX2.PAS
Created February 17, 2014 06:54
XXXX 2 - The ultimative DOOM 2-Clone
PROGRAM XXXX;
{********************************************
* X X X X 2 - The ultimative DOOM 2-Clone *
* *
* Author: B.M”ller *
* Publisher: B™MMSOFT (Germany) *
* *
* Date of begin: 14.04.95 *
* Date of end : __.__.__ *
@jaywilliams
jaywilliams / sub_category_products.xml
Created December 19, 2013 19:27
A vQmod for OpenCart 1.5.6 to display products in sub-categories.
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Display products in sub-categories while browsing a parent category</id>
<version>1.0.0</version>
<vqmver>2.4.0</vqmver>
<author>Jay Williams - [email protected]</author>
<file name="catalog/controller/product/category.php">
<operation>
<search position="after"><![CDATA['filter_category_id' => $category_id,]]></search>
<add><![CDATA[ 'filter_sub_category' => true,]]></add>
@stavrossk
stavrossk / horizontal menu using CSS Inline.html
Created November 25, 2013 09:48
An horizontal html navigation menu using CSS inline. In this example, we let the ul element and the a element float to the left. The li elements will be displayed as inline elements (no line break before or after the element). This forces the list to be on one line. The ul element has a width of 100% and each hyperlink in the list has a width of…
<html>
<head>
<style>
ul
@LeaVerou
LeaVerou / dabblet.css
Created November 9, 2013 16:43
Flexible Google-style progress indicator
/**
* Flexible Google-style progress indicator
*/
@keyframes progress {
50% { border-width: .5em 0; }
to { border-width: .5em 0 0 0; }
}
@keyframes rotate {
@stavrossk
stavrossk / PHP AJAX example.html
Last active December 21, 2015 05:39
PHP Snippet: - AJAX basic example: This code demonstrates basic AJAX functionality implemented with PHP and JavaScript.
<html>
<head>
<title>
PHP Demos
</title>
<style>
@stavrossk
stavrossk / PHP Encode email address.php
Last active December 21, 2015 05:29
PHP Snippet: Encode Email Address: With this snippet, you can encode any email address into HTML entities so that spam bots do not find it.
<?php
function encode_email($email='[email protected]', $linkText='Contact Us', $attrs ='class="emailencoder"' )
{
$email = str_replace('@', '&#64;', $email);
@stavrossk
stavrossk / PHP Human Readable Random String.php
Created August 14, 2013 18:29
PHP Snippet: Human Readable Random String: This code will create a human readable string that will look more close to dictionary words, useful for captchas.
<?php
/**************
*@length - length of random string (must be a multiple of 2)
**************/
function readable_random_string($length = 6)
@stavrossk
stavrossk / PHP Real client IP address retriever.php
Last active June 7, 2021 06:05
PHP Snippet: Get Real IP Address of Client: This function will fetch the real IP address of the user even if he is behind a proxy server.
<?php
function getRealIpAddr()
{
if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) )
{
@stavrossk
stavrossk / PHP Bulletin Board Code to HTML Converter.php
Last active December 21, 2015 02:09
PHP Snippet: BBS Code Converter: This script will convert Bulletin Board Code into readable HTML, good for comments, forums, etc.
<?php
function text2bbc($text)
{
$find = array
(
'~\[b\](.*?)\[/b\]~s',