Skip to content

Instantly share code, notes, and snippets.

View thedarsideofit's full-sized avatar

Diego Alcides Ramirez thedarsideofit

View GitHub Profile
@thedarsideofit
thedarsideofit / php-apcu-bc_on_ubuntu_16.04.md
Created September 27, 2019 04:38 — forked from philbot9/php-apcu-bc_on_ubuntu_16.04.md
Install php-acpu-bc on Ubuntu 16.04

The php-apcu-bc package provides a backwards compatibility layer from apcu -> apc, and is reuqired for some older PHP code bases (e.g. Yii 1). The package is not (yet) available in the Ubuntu 16.04 repos. To install it, use php-pear:

sudo apt-get install php-dev php-pear
sudo pecl install apcu_bc-beta

Then edit /etc/php/7.0/apache2/php.ini and add the following at the end of the file:

@thedarsideofit
thedarsideofit / freetds_install_ubuntu_14.md
Created January 14, 2019 22:44 — forked from ghalusa/freetds_install_ubuntu_14.md
Installing and Configuring FreeTDS on Ubuntu 14.04.4 LTS and Establish a Connection via PHP PDO

Installing and Configuring FreeTDS on Ubuntu 14.04.4 LTS and Establish a Connection via PHP PDO


Install

sudo apt-get install -y unixodbc unixodbc-dev unixodbc-bin libodbc1 odbcinst1debian2 tdsodbc php5-odbc
@thedarsideofit
thedarsideofit / prestashop.conf
Last active December 2, 2018 13:28 — forked from julienbourdeau/prestashop.conf
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
@thedarsideofit
thedarsideofit / mysql-levenshtein.sql
Created December 29, 2017 16:44 — forked from Kovah/mysql-levenshtein.sql
Levenshtein function for MySQL
-- Levenshtein function
-- Source: https://openquery.com.au/blog/levenshtein-mysql-stored-function
-- Levenshtein reference: http://en.wikipedia.org/wiki/Levenshtein_distance
-- Arjen note: because the levenshtein value is encoded in a byte array, distance cannot exceed 255;
-- thus the maximum string length this implementation can handle is also limited to 255 characters.
DELIMITER $$
DROP FUNCTION IF EXISTS LEVENSHTEIN $$
CREATE FUNCTION LEVENSHTEIN(s1 VARCHAR(255) CHARACTER SET utf8, s2 VARCHAR(255) CHARACTER SET utf8)
@thedarsideofit
thedarsideofit / surprise_tutorial.py
Created December 17, 2017 15:36 — forked from mahermalaeb/surprise_tutorial.py
The easy guide for building python collaborative filtering recommendation system in 2017
import zipfile
from surprise import Reader, Dataset, SVD, evaluate
# Unzip ml-100k.zip
zipfile = zipfile.ZipFile('ml-100k.zip', 'r')
zipfile.extractall()
zipfile.close()
# Read data into an array of strings
with open('./ml-100k/u.data') as f:
@thedarsideofit
thedarsideofit / ubuntu-node-js
Created December 3, 2017 15:31 — forked from stephanetimmermans/ubuntu-node-js
Install Node.js on Ubuntu 14.10
#https://www.digitalocean.com/community/articles/how-to-install-node-js-on-an-ubuntu-14-04-server
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
npm config set prefix ~/npm
#append to .bashrc
export PATH="$PATH:$HOME/npm/bin"
sudo chown -R `whoami` ~/.npm
@thedarsideofit
thedarsideofit / Apriori.py
Created September 17, 2017 03:15 — forked from marcelcaraciolo/Apriori.py
Apriori.py
#-*- coding:utf-8 - *-
def load_dataset():
"Load the sample dataset."
return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]]
def createC1(dataset):
"Create a list of candidate item sets of size one."
@thedarsideofit
thedarsideofit / README.md
Created April 6, 2016 13:57 — forked from debashisbarman/README.md
A Twitter bot that can retweet in response to the tweets matching particluar keyword (https://goo.gl/4whEIt)

#Creating a Twitter bot with Node.js Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)

##Tools we need Here are the tools we’ll be using to create the bot — 

  • Node.js installed in your machine
  • A registered Twitter account

Create a Twitter application

@thedarsideofit
thedarsideofit / gist:f08562558dd87172a28b
Created February 11, 2016 22:32 — forked from nostah/gist:d610459d50564c729c56
php swagger 2.0 api sample
<?php
use Swagger\Annotations as SWG;
/**
* @SWG\Swagger(
* basePath="/v1",
* host="api.local",
* schemes={"http"},
* produces={"application/json"},