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
/** | |
* Returns Mobile Speed & Optimization and Desktop Speed & Optimization values in six adjacent columns | |
* by Cagri Sarigoz | |
*/ | |
function checkAll(Url) { | |
//CHANGE YOUR API KEY WITH YOUR_API_KEY BELOW | |
var key = "YOUR_API_KEY"; | |
var serviceUrlMobile = "https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=" + Url + "&strategy=mobile&key=" + key; | |
var serviceUrlDesktop = "https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=" + Url + "&strategy=desktop&key=" + key; |
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
from random import randint | |
def recursive_mult(x, y): | |
if (x<10) or (y<10): | |
return x*y | |
x_str = str(x) | |
x_n = len(x_str) | |
y_str = str(y) | |
y_n = len(y_str) |
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
from random import randint | |
def karatsuba(x, y): | |
if (x<10) or (y<10): | |
return x*y | |
x_str = str(x) | |
x_n = len(x_str) | |
y_str = str(y) | |
y_n = len(y_str) |
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 simple example of how to access the Google Analytics API.""" | |
import argparse | |
from apiclient.discovery import build | |
from oauth2client.client import SignedJwtAssertionCredentials | |
import httplib2 | |
from oauth2client import client | |
from oauth2client import file |
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
#open gemius explorer | |
tell application "Terminal" | |
do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files/Gemius/gemiusExplorer/gemiusExplorer.exe" | |
end tell |
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
var key = "YOUR_API_KEY"; |
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
users = [{'username': 'alice', 'age': 23, 'play_time': 101}, | |
{'username': 'bob', 'age': 31, 'play_time': 88}, | |
{'username': 'ann', 'age': 25},] | |
superplayers = [user for user in users if 'play_time' in user] | |
print(superplayers) | |
# resource: https://blog.finxter.com/how-to-filter-a-list-of-dictionaries-in-python/ |
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
=REGEXMATCH(TOP_PEOPLE,"cagri|cargri|cargi") |
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
/** | |
* Returns the URL of a hyperlinked cell, if it's entered with hyperlink command. | |
* Supports ranges | |
* @param {A1} reference Cell reference | |
* @customfunction | |
*/ | |
function linkURL(reference) { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var formula = SpreadsheetApp.getActiveRange().getFormula(); | |
var args = formula.match(/=\w+\((.*)\)/i); |
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
// Add namespace for media:image element used below | |
add_filter( 'rss2_ns', function(){ | |
echo 'xmlns:media="http://search.yahoo.com/mrss/"'; | |
}); | |
// insert the image object into the RSS item | |
add_action('rss2_item', function(){ | |
global $post; | |
if (has_post_thumbnail($post->ID)){ | |
$thumbnail_ID = get_post_thumbnail_id($post->ID); |
OlderNewer