Skip to content

Instantly share code, notes, and snippets.

View csarigoz's full-sized avatar

Cagri Sarigoz csarigoz

View GitHub Profile
@csarigoz
csarigoz / send_data_to_citizenshipper.py
Last active May 15, 2024 07:28
Example webhook request to send from PetScreening to CitizenShipper
import requests
import json
# URL of the webhook
url = 'ENTER_THE_WEBHOOK_URL_HERE'
# Parameters to be sent in the POST request
data = {
'email': '[email protected]',
'first_name': 'Cagri'

Keybase proof

I hereby claim:

  • I am csarigoz on github.
  • I am cagrisarigoz (https://keybase.io/cagrisarigoz) on keybase.
  • I have a public key ASA8skjyK_eS6Pph-jSPBAyN2SbX1S0PJrBfyzXU_Qd1KAo

To claim this, I am signing this object:

@csarigoz
csarigoz / youtube_video_responsive_embed_example.html
Last active February 1, 2024 18:02
YouTube Video Responsive Embed Example
<div class="video-container">
<iframe src="https://www.youtube.com/embed/TcNaihIowlo?cc_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;iv_load_policy=3" frameborder="0" allowfullscreen=""></iframe>
</div>
@csarigoz
csarigoz / thumbnail-in-rss-feed.php
Last active November 20, 2023 07:54
Add thumbnail image of posts to WordPress RSS Feed -> Add to functions.php file of your theme
// 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);
@csarigoz
csarigoz / google-sheet-link_url.gs
Last active April 5, 2023 13:31
Google sheet custom function that returns the URL of a hyperlinked cell, if it's entered with hyperlink command.
@csarigoz
csarigoz / gist:cde2a4e2d8e684d042ffd5666aee0b8f
Created April 3, 2023 13:29
Google sheet custom formula to filter a column on pivot table by REGEXMATCH
=REGEXMATCH(TOP_PEOPLE,"cagri|cargri|cargi")
@csarigoz
csarigoz / filter_list_dict_key.py
Created July 4, 2022 16:06
Filter a List of Dictionaries By Key
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/
var key = "YOUR_API_KEY";
@csarigoz
csarigoz / run_exe_file_in_wine
Created March 8, 2016 08:24
Applescript for Running an exe file in wine
#open gemius explorer
tell application "Terminal"
do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files/Gemius/gemiusExplorer/gemiusExplorer.exe"
end tell
@csarigoz
csarigoz / Hello Analytics.py
Created August 20, 2015 05:20
Hello Analytics for python 3 (with converting p12 secrets file to pem)
"""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