This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color_theme] | |
background_color="f9f9f9" | |
completion_background_color="e5e5e5ff" | |
completion_selected_color="d5d5d5ff" | |
completion_existing_color="dfdfdf21" | |
completion_scroll_color="959595ff" | |
completion_font_color="454545ff" | |
caret_color="54494bff" | |
caret_background_color="000000ff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Place_Reviews { | |
// URL to the Google Place API | |
protected $apiUrl = 'https://maps.googleapis.com/maps/api/place/details/json'; | |
// Google Place ID | |
protected $place_id; | |
public function __construct($place_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sanitize Select fields | |
function sanitize_select($input, $setting) { | |
$input = sanitize_key($input); | |
$choices = $setting->manager->get_control($setting->id)->choices; | |
return (array_key_exists($input, $choices) ? $input : $setting->default); | |
} | |
// Sanitize Checkboxes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download into directory and run `python rename_files.py` | |
# importing os module | |
import os | |
# Function to rename multiple files | |
def main(): | |
for filename in os.listdir("./"): | |
# Replace commas in filename with nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registerBlockType( 'loomo/yoshi-cookies', { | |
category: 'mario-blocks', // Block category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* custom pagination with bootstrap .pagination class | |
* source: http://www.ordinarycoder.com/paginate_links-class-ul-li-bootstrap/ | |
*/ | |
function bootstrap_pagination( $echo = true ) { | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer | |
$pages = paginate_links( array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
HEADER = """ | |
==HELP DOCUMENT== | |
Indentation and Space Formatter by Lars Hedlund | |
==INSTRUCTIONS== | |
This program takes an argument using the command line and applies the corresponding | |
changes to the input document. The commands and changes are as follows: | |
------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#init | |
module Flight | |
attr_accessor :airspeed_velocity | |
def fly | |
"I'm a #{self.class.name}, I'm flying!" | |
end | |
end | |
# ============================= |