Skip to content

Instantly share code, notes, and snippets.

View jjwdesign's full-sized avatar

Jeff Walters jjwdesign

View GitHub Profile
@yidas
yidas / js-nl2br-br2nl.md
Last active September 7, 2024 01:46
JavaScript nl2br & br2nl functions

JavaScript nl2br & br2nl functions

The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.

These JavaScript functions consider whether to use insert or replace to handle the swap.

nl2br

@gokulkrishh
gokulkrishh / media-query.css
Last active November 4, 2024 09:18
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@pwenzel
pwenzel / lamp-stack-osx-virtualhostx.md
Last active September 23, 2024 11:14
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
@ashleydw
ashleydw / nginx.conf
Last active October 29, 2024 12:07
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@codeliner
codeliner / ObjectSelect.php
Last active December 27, 2023 19:32
DoctrineModule\Form\ObjectSelect fix to define custom value property
<?php
namespace Application\Form\Element;
use Application\Form\Element\ObjectSelect\Proxy;
use DoctrineModule\Form\Element\ObjectSelect as DoctrineObjectSelect;
/**
* Class ObjectSelect
*
* Extends doctrines ObjectSelect to provide own Proxy implementation
@jaboc83
jaboc83 / sigPadCompression.js
Last active May 3, 2021 16:01
jQuery Signature Pad Compression/Decompression algorithm
/** Reinflates a compressed signature string:
resolution = a representation of the resolution in
pixels of the canvas which this signature will be drawn
e.g. {x:800,y:200}
*/
var inflateToJsonSignature = function (deflatedSig, resolution) {
var components = [],
modifier = 1,
compressWithResolution = /^(?:\[(\d+)x(\d+)\])?([\w\W]*)/,
parsedSigString = deflatedSig.match(compressWithResolution),