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
<script> | |
var thisScript = document.scripts[document.scripts.length - 1]; | |
var parent = thisScript.parentElement; | |
const wrapper = document.createElement('div'); | |
wrapper.innerHTML = 'Output'; | |
parent.replaceChild(wrapper.firstChild, thisScript); | |
</script> |
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 svg = document.querySelector( "svg" ); | |
var svgData = new XMLSerializer().serializeToString( svg ); | |
var canvas = document.createElement( "canvas" ); | |
var ctx = canvas.getContext( "2d" ); | |
var img = document.createElement( "img" ); | |
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) ); | |
img.onload = function() { |
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
$xpath = new DOMXpath($dom); | |
$items = array(); | |
$expression = './/div[contains(concat(" ", normalize-space(@class), " "), " class-name ")]'; | |
foreach ($xpath->evaluate($expression) as $div) { | |
$items[] = $div; | |
} | |
echo $items[0]->getAttribute('otherattribute'); |
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 | |
//header('Content-Type: application/atom+xml'); | |
$url='http://example.com'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,$url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); | |
$output = curl_exec($ch); | |
echo $output; | |
curl_close($ch); |
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
tell application "System Preferences" | |
activate | |
reveal anchor "displaysNightShiftTab" of pane id "com.apple.preference.displays" | |
delay 1 | |
end tell | |
tell application "System Events" | |
tell process "System Preferences" | |
click checkbox 1 of tab group 1 of window 1 | |
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
tell application "System Events" | |
tell appearance preferences | |
set dark mode to not dark mode | |
end tell | |
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
tell application "System Preferences" | |
reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess" | |
end tell | |
tell application "System Events" to tell process "System Preferences" | |
repeat while not (exists of checkbox "Use grayscale" of group 1 of window "Accessibility") | |
delay 0.1 | |
end repeat | |
set theCheckbox to checkbox "Use grayscale" of group 1 of window "Accessibility" | |
tell theCheckbox |
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
[ | |
{ | |
"name": "about", | |
"version": "1.10.0" | |
}, | |
{ | |
"name": "animated-page-scroll", | |
"version": "1.2.0" | |
}, | |
{ |
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
{ | |
"filter.commentAfter" : "<!--<%=attr('id', '#') %><%= attr('class', '.')%>-->" | |
} |
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 up = true; | |
var value = 0; | |
var increment = 1; | |
var ceiling = 100; | |
var floor = -100; | |
if (up == true && value <= ceiling) { | |
value += increment | |
if (value == ceiling) | |
{up = false;} |
NewerOlder