Skip to content

Instantly share code, notes, and snippets.

View saas786's full-sized avatar
🏠
Working from home

saasfreelancer saas786

🏠
Working from home
View GitHub Profile

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@bueltge
bueltge / gist:1016758
Created June 9, 2011 13:46
Add Admin-User in WordPress via mySQL
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('99', 'my_login_name', MD5('my_password'), 'My Name', 'mail@example.com', '', '2011-06-09 00:00:00', '', '0', 'display_name');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '99', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '99', 'wp_user_level', '10');
@naholyr
naholyr / update-sublime-text.sh
Created September 6, 2011 15:27
Install or update Sublime Text from web site
#!/bin/bash
# Requirements: sed, grep, curl, pkill
# User configuration
LOCAL_INSTALL="/usr/lib/sublime-text-2" # Must be user-writable
REPO="dev" # "dev" for dev releases, or "2" for beta releases
TARGET_BUILD="Linux 32 bit" # can be one of "Windows", "Windows 64 bit", "OS X", "Linux 32 bit", "Linux 64 bit"
# Check if sublime text is running
@hileon
hileon / gist:1311735
Created October 25, 2011 07:39 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@bradt
bradt / wp-image-crop-position.php
Created November 29, 2011 20:56
WordPress: Set an image's crop position and rotates images based on EXIF information if necessary
<?php
/* Example Usage:
* bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
* bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
*/
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**
@johnmegahan
johnmegahan / functions.php
Created January 12, 2012 01:50
Extended Walker class for use with the Twitter Bootstrap toolkit Dropdown menus in Wordpress.
<?php
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
add_action( 'init', 'register_menu' );
@jasonrdsouza
jasonrdsouza / gmail.py
Created January 25, 2012 04:52
Python script to access a gmail account and download particular emails
import email, getpass, imaplib, os
detach_dir = '.' # directory where to save attachments (default: current)
user = raw_input("Enter your GMail username:")
pwd = getpass.getpass("Enter your password: ")
# connecting to the gmail imap server
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user,pwd)
m.select("cs2043") # here you a can choose a mail box like INBOX instead
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@kovshenin
kovshenin / image-shortcode.php
Created March 6, 2012 06:41
Image shortcode for WordPress
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"]
*
* @uses image_make_intermediate_size
*/
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/