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 gspread | |
import pandas | |
gc = gspread.login('my@email.com', 'supersecretepassword') | |
book = gc.open('Spreadsheet name') | |
sheet = book.sheet1 #choose the first sheet | |
dataframe = pandas.DataFrame(sheet.get_all_records()) |
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 | |
add_filter( 'bd_delete_attachment_excluded_attachment_ids', 'prefix_exclude_attachment_ids_from_deletion' ); | |
function prefix_exclude_attachment_ids_from_deletion( $attachment_ids ) { | |
return array( | |
100, | |
111, | |
112, | |
); | |
} |
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
config.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
end |
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 | |
function wpel_change_email_log_user_role( $capability ) { | |
return 'manage_options' // change this to the capability that you want. | |
} | |
add_filter( 'el_view_email_log_capability', 'wpel_change_email_log_user_role' ); |
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 | |
/** | |
* Expand short urls | |
* | |
* @param <string> $url - Short url | |
* @return <string> - Longer version of the short url | |
*/ | |
function expand_url($url){ | |
//Get response headers | |
$response = get_headers($url, 1); |
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 | |
/** | |
* Plugin Name: Dump Taxonomy | |
* Plugin URI: http://bulkwp.com | |
* Description: Dump all Taxonomy for debugging | |
* Version: 0.1 | |
* License: GPL | |
* Author: Sudar | |
* Author URI: http://sudarmuthu.com/ | |
*/ |
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
Intent sharingIntent = new Intent(Intent.ACTION_SEND); | |
Uri screenshotUri = Uri.parse(path); | |
sharingIntent.setType("image/png"); | |
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); | |
startActivity(Intent.createChooser(sharingIntent, "Share image using")); |
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 | |
/** | |
* Is the current page the last page of the multi-page post. | |
* | |
* @return bool True if last page, False otherwise. | |
*/ | |
function is_last_page() { | |
global $page, $numpages, $multipage; | |
if ( $multipage ) { |
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
# Before starting | |
x = {} | |
# After line 1 | |
x = { | |
CTO => 1 | |
} | |
# After line 2 | |
x = { |
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
a = new Array(); | |
for (var b = 0; b < 10; b++) { | |
a[0] |= b; | |
} | |
a = new Array(); | |
a[0] = 0; // just this change alone make code 2x faster | |
for (var b = 0; b < 10; b++) { | |
a[0] |= b; |