Skip to content

Instantly share code, notes, and snippets.

View djekl's full-sized avatar
:octocat:
Working from home

Alan Wynn djekl

:octocat:
Working from home
View GitHub Profile
@djekl
djekl / $config['base_dir']
Created May 1, 2013 14:05
substr(FCPATH, 0, -12) for the base path
+ $config['base_dir'] = substr(FCPATH, 0, -12);
- $config['base_dir'] = 'C:/xampp/htdocs/site';
<?php
//ENTER THE RELEVANT INFO BELOW
$mysqlDatabaseName ='corporat_ni';
$mysqlUserName ='corporat_user';
$mysqlPassword ='FCx313MY';
$mysqlHostName ='localhost';
$mysqlImportFilename ='mysqldump.sql';
//DISPLAY MYSQL PASSWORD? (TRUE/FALSE)
$displayPassword = TRUE;
<?php
/**
* Generate an encryption key for CodeIgniter.
* http://codeigniter.com/user_guide/libraries/encryption.html
*/
// http://www.itnewb.com/v/Generating-Session-IDs-and-Random-Passwords-with-PHP
function generate_token ($len = 32)
{
<?php
/*
* Data encryption in PHP.
*
* This script is released into the public domain by Defuse Security.
* You may use it for any purpose whatsoever and redistribute it with or without
* modification.
*
* https://defuse.ca/secure-php-encryption.htm
#!/bin/sh
## clear the output
#clear
echo "\n"
## auth the sudo command
sudo -p "Please enter you admin password: " whoami 1>/dev/null
if [ "$(sudo whoami)" != 'root' ]; then
echo "You entered an invalid password or you are not an admin/sudoer user!\n\nScript aborted"
@djekl
djekl / Sublime Text 2 - Useful Shortcuts (Mac OS X).textile
Created June 5, 2013 16:33 — forked from jonahvsweb/gist:4354137
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@djekl
djekl / video_details.php
Created June 21, 2013 15:50
Get Video Details from YouTube or Vimeo
<?php
$urls = array();
$videos = array();
// vimeo test
$urls[] = 'http://vimeo.com/6271487';
$urls[] = 'http://vimeo.com/68546202';
// youtube test
@djekl
djekl / index.html
Created July 6, 2013 11:42
A CodePen by Alan Wynn. Linkify!
<span>
Any and all links below should be now "linkified"
</span>
<p>
<a href="https://google.com">Google</a> <br>
<a href="https://bing.com">Bing</a> <br>
</p>
@djekl
djekl / gist:5949771
Created July 8, 2013 15:21
Create a user and give it access to all database that begin with username_
GRANT ALL ON `USERNAME\_%`.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD';
@djekl
djekl / .gitignore
Created July 12, 2013 10:03
Default .gitignore used to start projects
########################################
### SOME SENSIBLE DEFAULTS BELOW ###
# https://github.com/github/gitignore #
########################################