Skip to content

Instantly share code, notes, and snippets.

View fnhipster's full-sized avatar
💭
clear cache && refresh

Carlos A. Cabrera fnhipster

💭
clear cache && refresh
View GitHub Profile
@fnhipster
fnhipster / prune
Created June 30, 2020 23:24 — forked from dannygsmith/valet-plus-destroy
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
version: '3.0'
services:
db:
image: mariadb:10.2
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magentou
@fnhipster
fnhipster / gist:6232386
Created August 14, 2013 15:53
Responsive breakpoitns
@media only screen and (min-width: 768px) {
/* tablets and desktop */
}
@media only screen and (max-width: 767px) {
/* phones */
}
@media only screen and (max-width: 767px) and (orientation: portrait) {
/* portrait phones */
@fnhipster
fnhipster / gist:5460604
Created April 25, 2013 15:27
Mobile/Desktop htaccess redirect
# MOBILE REDIRECT
RewriteCond %{REQUEST_URI} !/mobile.*$
RewriteCond %{REQUEST_URI} !/hub.*$
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ /mobile [L,R=302]
# if a user is accessing a mobile page from desktop then show desktop version
RewriteCond %{HTTP_USER_AGENT} "!android|!blackberry|!iphone|!ipod|!iemobile|!opera mobile|!palmos|!webos|!googlebot-mobile" [NC]
RewriteRule ^mobile/(.*)$ / [L,R=302]
@fnhipster
fnhipster / hack.sh
Created April 1, 2012 00:08 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@fnhipster
fnhipster / gist:1174272
Created August 26, 2011 19:53
Get boxes in the last column and row of a table of 3 columns
// Making fancy borders on the product listing page.
var total = $(".ProductList li").length;
var last_row = Math.ceil(total/3);
var n;
var current_row;
$(".ProductList li").each(function(i){
n = i+1;
current_row = Math.ceil(n/3);
/* You must be using jQuery and jQuery UI (w/ Autocomplete)
* http://jqueryui.com/demos/autocomplete/
*/
// For Comma Splitting
function split( val ) {
return val.split( /,\s*/ );
}
function extractLast( term ) {
@fnhipster
fnhipster / html5.haml
Created April 9, 2011 01:19
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
@fnhipster
fnhipster / gist:778245
Created January 13, 2011 17:42
WordPress Nav Menu (InfusionWP) Email
<div id="log_in">
<?php global $user_ID;
if ('' != $user_ID) {
wp_nav_menu('menu=Logged In Users&menu_class=dd-menu');
} else { ...
@fnhipster
fnhipster / gist:771489
Created January 9, 2011 06:39
Remove dotted border on hyperlinks in Firefox
a:active, a:focus {
outline: none;
-moz-outline-style: none;
}