Skip to content

Instantly share code, notes, and snippets.

View justindmartin's full-sized avatar

Justin Martin justindmartin

  • Shreveport, LA
View GitHub Profile
@justindmartin
justindmartin / Global CSS Styles.css
Created September 2, 2012 20:29
These are some Global CSS rules that I use to maintain identical feel across all browsers
/* Global */
*{padding:0px; margin:0; border:none; outline:none; color:#333; font-family:Arial,Helvetica,sans-serif;}
*:focus{border:none; outline:none;}
html,body{height:100%;}
h1{font-size:32px !important;}
h2{font-size:24px !important;}
h3{font-size:19px !important;}
h4{font-size:16px !important;}
h5{font-size:13px !important;}
h6{font-size:11px !important;}
@justindmartin
justindmartin / CSS, JS, HTML Minifier.php
Last active September 2, 2017 14:20
CSS, JS, and HTML minifier, written in PHP - requires JSMin.php
<?php
/* require JSMin class file */
require_once('JSMin.class.php');
class minifier{
function __Construct(){
}
function minifyCSS($CSS) {
/* remove comments */
$CSS = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $CSS);
@justindmartin
justindmartin / JSMin.class.php
Created March 4, 2013 03:44
JSMin -- Ryan Grove <[email protected]> (PHP port) -- Steve Clay <[email protected]> (modifications + cleanup) -- Andrea Giammarchi <http://www.3site.eu> (spaceBeforeRegExp) -- 2002 Douglas Crockford <[email protected]> (jsmin.c) -- 2008 Ryan Grove <[email protected]> (PHP port) -- http://opensource.org/licenses/mit-license.php MIT License -- http:…
<?php
/**
* JSMin.php - modified PHP implementation of Douglas Crockford's JSMin.
*
* <code>
* $minifiedJs = JSMin::minify($js);
* </code>
*
* This is a modified port of jsmin.c. Improvements:
*
@justindmartin
justindmartin / eliminateDistractions.py
Created April 20, 2013 18:33
Script to block websites, which are distractions during coding
import sys
#open hosts file and read current data
hostsFile = open("/etc/hosts", "w+")
hostsFileData = hostsFile.read()
#host list
newHosts = [
"facebook.com",
"quora.com",
@justindmartin
justindmartin / Sigmoid Function.php
Last active February 8, 2019 18:07
This is a sigmoid function in PHP.
<?php
function sigmoid($t){
return 1 / (1 + pow(M_EULER, -$t));
}
?>
ssh -p remotePort -D localPort -C -q -N user@remoteHost
@justindmartin
justindmartin / convertAnswerNumberToLetters.php
Created September 4, 2013 03:38
This converts answer choice numbers to letters.
function convertAnswerNumberToLetters($number){
$LETTERS_DICTIONARY = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$MAX_ITERATIONS = 20;
$letters = '';
$numIterations = 0;
while($number > 0 && $numIterations <= $MAX_ITERATIONS){
$index = $number;
for($temp = 0; $temp < $MAX_ITERATIONS && $temp < $number && $temp > 26; $temp -= 26){
@justindmartin
justindmartin / ron_nginx_configuration.conf
Created October 7, 2013 14:20
Getting started Nginx configuration for Ron.
server {
listen 80;
root #replace this with the default full path to where all of your PHP files are;
index home;
server_name www.jumalabs.com #change to desired name, such as flipquiz.jumalabs.com;
location / {
rewrite ^/(.*)$ /index.php?url=$1 break;
navigator.geolocation.getCurrentPosition(function(pos) {
var coords = pos.coords;
Pebble.showSimpleNotificationOnPebble('Hello!',
'Your coordinates are ' + coords.latitude + ', ' + coords.longitude);
)}