Skip to content

Instantly share code, notes, and snippets.

View king724's full-sized avatar

Kevin King king724

View GitHub Profile
@BHSPitMonkey
BHSPitMonkey / generate_code39_barcode.php
Created September 8, 2010 19:32
A PHP function that generates a Code 39 type barcode in pure HTML/CSS
// Prints out a Code 39 barcode in HTML/CSS
// $string should be a Code 39-compliant string to encode.
// Any characters not in the array below will be discarded.
function print_code39_barcode($string) {
$code39 = array(
'0'=>'NnNwWnWnN', '1'=>'WnNwNnNnW',
'2'=>'NnWwNnNnW', '3'=>'WnWwNnNnN',
'4'=>'NnNwWnNnW', '5'=>'WnNwWnNnN',
'6'=>'NnWwWnNnN', '7'=>'NnNwNnWnW',
'8'=>'WnNwNnWnN', '9'=>'NnWwNnWnN',
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@peterjmit
peterjmit / doctrine_cache_driver.php
Created March 6, 2012 17:47
Get the Result Cache from the doctrine entity manager
<?php
class Foo
{
private $_em;
public function __construct($entity_manager)
{
$this->_em = $entityManager;
}
@paulnicholson
paulnicholson / powssl
Last active November 24, 2021 16:40
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@jai-o
jai-o / htaccess-try97
Created April 5, 2012 18:47
Works! Removes Index.php, Force HTTPS, removes www
RewriteEngine On
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1
# Depends on your web host and setup, check with your web host specific settings
RewriteCond %{ENV:SECURE_REDIRECT} !=on
@clawfire
clawfire / bcrypt.class.php
Created June 7, 2012 08:23
Bcrypt Class
<?php
class Bcrypt
{
private $rounds;
public function __construct($rounds = 12)
{
if (CRYPT_BLOWFISH != 1) {
throw new Exception("bcrypt not supported in this installation. See http://php.net/crypt");
}
@alexbilbie
alexbilbie / composer.json
Created October 14, 2012 16:16
OAuth2 client example
{
"require": {
"lncd/oauth2-facebook": "*",
"slim/slim": "2.*"
},
"minimum-stability": "dev"
}
@max-mapper
max-mapper / readme.md
Last active October 12, 2015 10:17
introduction to node
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@akuzemchak
akuzemchak / l4project.sh
Last active November 16, 2023 08:48
New L4 project with clean history
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit