Skip to content

Instantly share code, notes, and snippets.

View darkcolonist's full-sized avatar
🐣
I rise from the fire, stronger and brighter.

Christian Noel Reyes darkcolonist

🐣
I rise from the fire, stronger and brighter.
View GitHub Profile
@darkcolonist
darkcolonist / designer.html
Last active August 29, 2015 14:23
designer
<link href="../core-scaffold/core-scaffold.html" rel="import">
<link href="../core-header-panel/core-header-panel.html" rel="import">
<link href="../core-menu/core-menu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../core-icon-button/core-icon-button.html" rel="import">
<link href="../core-toolbar/core-toolbar.html" rel="import">
<link href="../core-input/core-input.html" rel="import">
<link href="../speech-mic/speech-mic.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<link href="../google-map/google-map.html" rel="import">
@darkcolonist
darkcolonist / basic-logger.php
Last active September 3, 2015 09:49
php basic logging helper function
<?php
/**
* create a log given the dump, the file and the directory
* @author darkcolonist@gmail.com
* @date 2015-07-30
* @param text $dump dump file to be logged
* @param string $name name of the log file
* @param string $directory location of the log file
* @return boolean success
*/
@darkcolonist
darkcolonist / my.cnf
Last active August 29, 2015 14:27
mysql default configuration and how to install separate instance of mariadb using same binaries
# Author: Christian Noel Reyes <darkcolonist@gmail.com>
# Description: My default my.cnf file contents using MariaDB
# Note:
# replace all [instance-name] with your instance name of choice, in my
# case: mariadb-test-instance-50001
# replace all [install-dir] with your install directory /
# data directory of choice, in my case (also note the trailing
# slash): D:/mariadb-10.0.19-winx64/test-instance-50001/
# replace all [port] with your port of choice, in my case: 50001
@darkcolonist
darkcolonist / show all hidden.js
Created August 18, 2015 03:20
display all hidden fields in the page using jquery and jqueryui
{
showAllHidden : function(){
var table = $("<table>");
for (var i = 0; i < $("[type=hidden]").length; i++) {
table.append(
"<tr><td>"+$("[type=hidden]")[i].name+"</td><td><strong>"+$("[type=hidden]")[i].value+"</strong></td></tr>"
);
};
@darkcolonist
darkcolonist / javascript array.js
Created August 20, 2015 04:43
javascript array
// instantiation then initialization
var foodList = [];
// population
foodList.push("rice");
foodList.push("salad");
foodList.push("veggies");
foodList.push("meat");
foodList.push("fish");
@darkcolonist
darkcolonist / include_dir.js
Last active September 10, 2015 09:03 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
/**
* include all js files in directory (node.js)
*
* each file included is concatenated to the file where it was included
* like in php
*/
var fs = require("fs");
function include_dir(dir, recurse, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
#console p{
padding-left: 20px;
text-indent: -20px;
}
@darkcolonist
darkcolonist / installing mongo for php5.3vc6.txt
Last active November 17, 2015 06:34
installing mongo for php5.3vc6
not highly recommended but will make you work with mongo on your legacy vc6 php installation
download your required dll here;
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
i used:
https://s3.amazonaws.com/drivers.mongodb.org/php/mongo-1.1.4.zip
then because my version was php5.3vc6
i extracted php_mongo.dll from;
@darkcolonist
darkcolonist / populate.js
Last active November 20, 2015 08:38
nodejs insert random people in db
var mongojs = require("mongojs"),
db = mongojs('test', ['people'])
var names1 = [ "Matthew","Carlos","Cornelia","Alan","Samuel","Jeanette","Joel","Polly","Mathilda","Larry","Jane","Lucy","Gavin","Mable","Bertie","Mark","Travis","Dorothy","Stanley","Phoebe","Arthur","Sadie","Mark","Lewis","Alex","Callie","Winnie","Elijah","Johnny","Adelaide","Jayden","Clara","Barbara","Laura","Francis","Harvey","Marc","Nannie","Joseph","Nellie","Frank","Julian","Belle","Amelia","Elizabeth","Caleb","Jessie","Derek","Grace","Nathaniel","Christian","Nellie","Elsie","Maurice","Jared","Cecelia","Martha","Eula","Jean","Ricardo","Mittie","Luis","May","Landon","Jennie","Eula","Belle","Ivan","Hallie","Robert","Eleanor","Sarah","Lou","Olivia","Christina","Wayne","Larry","Celia","Herman","Charlotte","Barry","Martin","Frances","Raymond","Ricky","Cody","Rena","Garrett","Janie","Lenora","Emilie","Iva","Edward","Evelyn","Lydia","Terry","Betty","Lydia","Nathaniel","Myra" ]
var names2 = [ "Evan","Gregory","Alvin","Albert","Derek","Amanda"
@darkcolonist
darkcolonist / actions.txt
Last active October 26, 2016 03:13
BASH WGET iterator / CRON alternative per second instead of per minute for Linux, forked from https://github.com/darkcolonist/snippets/blob/master/cron%20alternative%20per%20second.txt
# this is a comment and it will not be run!
#http://192.168.1.61/test/curlable.php
http://192.168.1.61/test/curlable.php?client=nechrons
#http://192.168.1.61/test/curlable.php?client=space
#http://192.168.1.61/test/curlable.php?client=olympus
#http://192.168.1.61/test/curlable.php?client=thanus
#http://192.168.1.61/test/curlable.php?client=jupiter
http://192.168.1.61/test/curlable.php?client=chronus
#http://192.168.1.61/test/curlable.php?client=thanatos