Skip to content

Instantly share code, notes, and snippets.

View the94air's full-sized avatar
🐞
Looking for bugs. Pushing fixes.

Abdalla Arbab the94air

🐞
Looking for bugs. Pushing fixes.
View GitHub Profile
@mikejolley
mikejolley / gist:2044101
Last active May 18, 2021 17:02
WooCommerce - Show number of items in cart and total
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
@YoSmudge
YoSmudge / dropdown.css
Created March 27, 2012 10:43
Pure HTML/CSS Dropdown Select Menu
/*Add cursor to the spans and labels*/
form .mycssdropdown li label, form .mycssdropdown li label span{
cursor:pointer;
}
/*By default, hide the spans*/
form .mycssdropdown li label span{
display:none;
}
@dantunes
dantunes / gist:2366856
Created April 12, 2012 12:11
Undo a git add - remove files staged for a git commit
#Unstage a single file from the "about to be commited"
git reset filename.txt
#Unstage a "git add ."
git reset
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@evenchange4
evenchange4 / step.md
Created September 23, 2012 21:55
Deploy a Express.js project on Heroku

Deploy a Express.js project on Heroku

Step by step from command line by Michael Hsu

Quick start

Create a Node.js web framework 'express'

$ express myfirstexpress && cd myfirstexpress

Declare dependencies with NPM /package.json

@sambody
sambody / tooltip with arrow down
Created June 29, 2013 21:50
CSS: arrow down on tooltip with border
/*
check in IE, might need ":" instead of "::"
HTML: <p class="tooltip">Some text</p>
*/
/* tooltip element with border */
.tooltip {
position:relative;
padding:15px;
margin:1em 0 3em;
@tobysteward
tobysteward / BlogController.php
Last active March 4, 2024 23:11
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@claudiosanches
claudiosanches / django-runserver-ssl.md
Last active February 20, 2024 09:59
Django - SSL with runserver

Instalation

[sudo] apt-get install stunnel

Configuration

cd path/to/django/project
alert('hello ' + document.location.href);
@patrickgilmour
patrickgilmour / woocommerce-simple-or-variable.php
Created June 27, 2014 17:57
WooCommerce conditional to test if a Product is Simple or Variable.
<?php
/**
* Is a WooCommerce Product Simple or Variable
*
* see http://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable
*/
if( $product->is_type( 'simple' ) ){
// a simple product