Skip to content

Instantly share code, notes, and snippets.

/*
* Inspired by:
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed
/*
*
* Originally inspired by: http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* Original source by https://gist.github.com/highrockmedia/3710930
*
* My contribution: I re-wrote some code it to fire as one function, so you're only editing values in one place.
*
*/
@midoooo
midoooo / grid-rtl
Created September 1, 2014 23:37 — forked from anonymous/grid-rtl
/*!
* Bootstrap v3.2.0 Grid, Cleaned and manually minified by Nadir, grab a LTR version at
* https://gist.github.com/anonymous/58b6b2de80e56acf08bc
*/
input,
button,
select,
textarea {
font-family: inherit;
__author__ = 'Eslam Hamouda | eslamx.com'
import configparser
import os.path
import json
import io
# get the required files paths to access Firefox AppData
win_user_profile = os.getenv('USERPROFILE')
@midoooo
midoooo / index.php
Last active August 29, 2015 14:21 — forked from no1k/index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Single Upload Form with PHP</title>
</head>
<body>
<form method="POST" action="upload.php" enctype="multipart/form-data">
<label for="file"> Pick a file : </label>
function hex2rgb($hex) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));
@midoooo
midoooo / unshorten.php
Last active August 29, 2015 14:24 — forked from marijn/unshorten.php
<?php
/**
* @link http://jonathonhill.net/2012-05-18/unshorten-urls-with-php-and-curl/
*/
function unshorten_url($url) {
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_FOLLOWLOCATION => TRUE, // the magic sauce
CURLOPT_RETURNTRANSFER => TRUE,
@midoooo
midoooo / fbUrlCheck.php
Last active August 29, 2015 14:26 — forked from atomicpages/fbUrlCheck.php
A simple facebook URL checker RegEx for PHP or JavaScript
<?php
/**
* A simple regex to test whether or not a facebook url is valid. For basic usage, this will do the job.
* @see Test cases <http://ideone.com/ZMJp4f>
*/
$fbUrlCheck = '/^(https?:\/\/)?(www\.)?facebook.com\/[a-zA-Z0-9(\.\?)?]/';
$secondCheck = '/home((\/)?\.[a-zA-Z0-9])?/';
$validUrl = 'https://www.facebook.com/atomicpages/';