Skip to content

Instantly share code, notes, and snippets.

View DannyNunez's full-sized avatar

Danny Nunez DannyNunez

View GitHub Profile
@DannyNunez
DannyNunez / Bootstrp helpers
Created July 22, 2013 19:04
BootStrap - helpers
Dropdown / flyout menu
http://jsfiddle.net/4nMkh/4/
@DannyNunez
DannyNunez / Codeigniter-WebConfig.xml
Created May 1, 2013 16:33
remove index.php from urls in codeigniter
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
@DannyNunez
DannyNunez / csvToArray.php
Created March 19, 2013 16:39
csv to php array
<?php
$data = array();
$results = file_get_contents('info.csv');
$string = explode("\n", $results);
foreach ($string as $row) {
$data[] = explode(',', preg_replace('/"/', "", $row));
}
echo "<pre>";
print_r($data);
echo "</pre>";

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

@DannyNunez
DannyNunez / MSSQLQueries
Last active December 14, 2015 17:09
useful MSSQL Queries
Delete All Tables from a selected database.
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
#####################################################################
Delete all records froma table
USE [DATABASE NAME]
DELETE FROM [DATABASE NAME].[dbo].[TABLE NAME]
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
<add value="default.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
@DannyNunez
DannyNunez / netbeans-tips.txt
Last active December 11, 2015 17:38
Netbeans Tips
Remove Blank Lines
\n\s*(\n)
$1
Code navigation
Ctrl+Click on a method/class/function go into the class (if it’s a dependent project/libraries, add those in the project properties)
Alt+Left, Alt+Right navigate back/forward when using the ctrl+click feature
# Install Dependencies
# sudo apt-get install build-essential
# sudo apt-get build-dep php5
sudo apt-get install libmysqlclient-dev mysql-client libcurl4-openssl-dev libgd2-xpm-dev libjpeg-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev bzip2 libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev libmagickcore-dev imagemagick libreadline-dev libc-client-dev libsnmp-dev snmpd snmp libvpx-dev libxpm-dev libgmp3-dev libicu-dev libpspell-dev libtidy-dev freetds-dev unixodbc-dev librecode-dev libglib2.0-dev libsasl2-dev libgeoip-dev imagemagick libmagickcore-dev libmagickwand-dev
# Stop Apache
sudo service apache2 stop
# Cleanup Packages
sudo apt-get autoremove
h1. Sublime Text 2 - Useful Shortcuts (PC)
Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.
h2. Editing
| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |
@DannyNunez
DannyNunez / set-and-include-from-server-root.php
Created January 9, 2013 15:23
Set variable for server root to include path globally to your sites.
<?php
$new_root = explode('/',$_SERVER['DOCUMENT_ROOT']);
array_pop($new_root);
include_once(implode('/',$new_root).'path to file');
?>