Skip to content

Instantly share code, notes, and snippets.

View soardex's full-sized avatar

Edward Fitz Bucud Abucay soardex

View GitHub Profile
@soardex
soardex / CVS2JSON_OF.pl
Created April 24, 2014 09:37
CVS to JSON and outputs as file.
use strict;
use warnings;
use JSON;
my $file = 'table_YHOO.csv';
my @data;
open(my $fh, '<', $file) or die "Can't read '$file' [$!]\n";
while (my $line = <$fh>) {
@soardex
soardex / OCVS2MYSQL.pl
Created May 1, 2014 10:53
Get CVS from remote host then save to a MySQL database.
use strict;
use warnings;
use DBI;
use Time::Local;
use LWP::Simple;
sub trim {
my $s = shift;
$s =~ s/^"|"$//g;
@soardex
soardex / CVS2MYSQL.pl
Created May 1, 2014 10:56
Save CVS contents to MySQL database.
use strict;
use warnings;
use DBI;
sub trim {
my $s = shift;
$s =~ s/^"|"$//g;
$s =~ s/^\s+|\s+$//g;
return $s;
}
@soardex
soardex / DLSHARK.py
Created May 1, 2014 14:35
Original from George Stephanos. Minimalize and removed the GUI. A Groove Downloader.
#!/usr/bin/env python
import httplib
import StringIO
import hashlib
import uuid
import random
import string
import sys
import os
@soardex
soardex / OCVS2MYSQL.php
Created May 5, 2014 16:48
A PHP script to get CVS from remote host then save to a MySQL database.
<?php
$mysqli = new mysqli("localhost", "root", "toor", "khfinance");
if ($mysqli->connect_errno) {
print("Failed to connect to MySQL: " . $mysqli->connect_error);
}
$query = "SELECT * FROM khf_symbols";
if ($result = $mysqli->query($query)) {
while ($row = $result->fetch_assoc()) {
@soardex
soardex / OCVS2MYSQL_V2.pl
Created May 5, 2014 16:51
Get CVS from remote host then save to a MySQL database. Updated with insert to map table.
use strict;
use warnings;
use DBI;
use Time::Local;
use LWP::Simple;
sub trim {
my $s = shift;
$s =~ s/^"|"$//g;
@soardex
soardex / KOHANA_VHOST_NGINX.conf
Created May 22, 2014 01:10
Kohana on nginx vhost.
#user nobody;
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
@soardex
soardex / MUYEOG.sql
Created May 22, 2014 02:26
Dump of MariaDB on Test Server.
-- Adminer 4.1.0 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
USE `muyeog`;
DROP TABLE IF EXISTS `cn_assets`;
@soardex
soardex / REEL_CHECK.py
Created June 8, 2014 14:17
Reel check and save combinations
#!/usr/bin/env python
# Specifications:
# - 5x3 reel
# - left-to-right checking
# Winning Combinations:
# TOP TOP TOP TOP TOP
# MID MID MID MID MID
# BOT BOT BOT BOT BOT
@soardex
soardex / REEL_WINLINE.js
Created June 23, 2014 17:08
Simple reel winline check
"use strict";
var ERRR = 1;
var WARN = 2;
var LOG0 = 3;
var LOG1 = 4;
var LOG2 = 5;
var DEBUG = LOG0;
var PLOOKUP = [