These are a few utility functions useful for parsing the CustomTargeting field present in your DFP (GAM) tables
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
javascript:try{document.querySelector('video').requestPictureInPicture()}catch(e){alert("sorry:\n"+e)} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
(function(j,w,d){ | |
try { | |
j = ''; | |
//this works just fine to collect the json (assuming the JSON result tab is open in BigQuery) | |
for (e of document.getElementsByClassName("CodeMirror-code")[1].getElementsByClassName("CodeMirror-line")) { | |
j+= (e.innerText.trim()); | |
} | |
w = window.open('about:blank','','width=900,height=700,resizeable,scrollbars'); | |
d = w.document; | |
//this fails with ContentSecurity errors - see console of opened window for details |
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
toggle_wifi() { | |
networksetup -getairportpower en${n}; | |
if test $? -eq 0; | |
then | |
echo WiFi interface found: en${n}; | |
eval "networksetup -setairportpower en${n} off" | |
eval "networksetup -setairportpower en${n} on" | |
return 0; | |
fi | |
return 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
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>Dell</vendorname> | |
<vendorid>16700</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>Dell USB Keyboard</productname> | |
<productid>8195</productid> |
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
-- Generates an array of dates matching the Nth (1st - 5th) weekday (Sun, Mon, Tue, etc) of each month | |
-- from startDate to endDate | |
CREATE OR REPLACE FUNCTION `yourProject.yourDB.getNthWeekdayOfMonth`(Nth INT64, weekday STRING, startDate DATE, endDate DATE) RETURNS ARRAY<DATE> AS ( | |
( | |
select array | |
( | |
select dt from | |
( | |
select dt, | |
rank() over (partition by format_date("%a%b%Y", dt) order by dt) as WeekDayOfMonth, |
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
on run {input, parameters} | |
activate application "SystemUIServer" | |
tell application "System Events" | |
tell process "SystemUIServer" | |
-- sourced from https://superuser.com/a/1348751 | |
-- Working CONNECT Script. Goes through the following: | |
-- Clicks on Bluetooth Menu (OSX Top Menu Bar) | |
-- => Clicks on device Item | |
-- => Clicks on Connect Item |
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
javascript:(function(){window.open("https://www.google.com/search?q=site:"+location.hostname.replace("www.","")+" "+window.prompt("Enter site search terms"))})() |