Skip to content

Instantly share code, notes, and snippets.

View NoMan2000's full-sized avatar

Michael Ryan Soileau NoMan2000

  • Surge Forward
  • Reno, Nevada
View GitHub Profile
@jackvial
jackvial / gist:2bbddd6d8c3d1b2a09c2
Created July 20, 2014 19:01
Install ODBC for PHP, Apache on Ubuntu 14.04
$ sudo apt-get install freetds-bin freetds-common tdsodbc odbcinst php5-odbc unixodbc
$ sudo mv /etc/odbcinst.ini /etc/odbcinst.ini.bak
$ sudo find / -name odbcinst.ini
$ sudo cp /usr/share/tdsodbc/odbcinst.ini /etc/
$ sudo service apache2 restart
@agarzon
agarzon / DbHelper.php
Last active February 18, 2025 05:42
Codeception DB helper to extend database functionalities (update & delete)
<?php
namespace Codeception\Module;
/**
* Additional methods for DB module
*
* Save this file as DbHelper.php in _support folder
* Enable DbHelper in your suite.yml file
* Execute `codeception build` to integrate this class in your codeception
*/
<?php
/**
* Join a string with a natural language conjunction at the end.
*/
function natural_language_join(array $list, $conjunction = 'and') {
$last = array_pop($list);
if ($list) {
return implode(', ', $list) . ' ' . $conjunction . ' ' . $last;
}
return $last;
@asyncanup
asyncanup / simple-javascript-assert.md
Last active May 11, 2022 01:03
Simple JavaScript assert

Why you need assertions

It's better to fail with your own error than undefined is not a function.

A simple assertion solution would let your application fail early and fail at the right point in runtime execution. Allowing you to handle it better.

How you write assertions

@mageekguy
mageekguy / gist:29cdf2e52d1c507f25b3
Last active October 24, 2015 22:33
Mysqli and generator are in a boat...
<?php
namespace db;
class client
{
private
$user,
$password,
$host,
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active July 25, 2025 09:29
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 28, 2025 19:10
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@NoMan2000
NoMan2000 / files.sh
Last active April 14, 2025 17:54
Change Permissions on Unix to 775 for directories and 664 for files
sudo find . -type f | xargs chmod -v 664
sudo find . -type d | xargs chmod -v 775
sudo chmod -R u=rwX,g=rwX,o=rX .
sudo chown -R ubuntu:www-data .
@fogartyp
fogartyp / JavaPkg.build
Last active December 10, 2015 16:56
Creating a custom Java Runner on C9 IDE
// Create a custom Cloud9 build system - similar to the Sublime build system
// For more information see https://docs.c9.io/custom_runners.html
{
"cmd": [
"bash",
"-c",
"mkdir -p $(echo $file | sed -r \"s_/src/.*_/_g\")bin; find $(echo $file | sed -r \"s_/src/.*_/_g\")src -name '*.java' -print | xargs javac -sourcepath $(echo $file | sed -r \"s_/src/.*_/_g\")src -d \"$(echo $file | sed -r \"s_/src/.*_/_g\")bin\""
],
"info": "\\033[01;34mBuilding\\033[00m \\033[01;31m$project_name\\033[00m",
"selector": "source.java",
@aswad32
aswad32 / ElasticSearch5-Kibana-xpack
Created November 15, 2016 23:09
Installing ElasticSearch 5.0.0, Kibana 5.0.1 and X-Pack with Homebrew
#install elasticsearch (this will install elasticsearch as a services and automatically start after installation done)
brew install elasticsearch
#install x-pack plugin for elasticsearch
elasticsearch-plugin install x-pack
#download kibana from https://www.elastic.co/products/kibana
copy the archive to some where that can easily accessible
#install x-pack for kibana (change directory to kibana bin directory)