This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Are you online?</title> | |
| <style> | |
| body { | |
| color: #fff; | |
| font-family: sans-serif; |
This file contains hidden or 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
| convert -density 300 test.svg -colorspace CMYK -profile colorProfiles/ISOcoated_v2_eci.icc out8.pdf |
This file contains hidden or 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 callAjax(url, callback) { | |
| var xmlhttp; | |
| xmlhttp = new XMLHttpRequest(); | |
| xmlhttp.onreadystatechange = function () { | |
| if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { | |
| callback(JSON.parse(xmlhttp.responseText)); | |
| } | |
| } | |
| xmlhttp.open('GET', url, true); | |
| xmlhttp.send(); |
This file contains hidden or 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
| bye; | |
| # from: http://superuser.com/questions/1081539/delete-files-with-same-size-but-keep-always-one-file | |
| # find the files to keep | |
| find . -type f -printf "%s %p\n" | grep "zip" | sort -n | uniq -d --check-chars=10 > files.txt | |
| # here it goes! | |
| mkdir unique |
This file contains hidden or 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 | |
| /* instead using this headers | |
| header('Content-type: application/octet-stream'); | |
| header('Content-Disposition: attachment; filename="'.$filename.'"'); | |
| // use this headers */ | |
| header("Content-type: application/pdf"); | |
| header("Content-Length: ".$length); | |
| header("Content-Disposition: inline; filename=\"".$filename."\""); |
This file contains hidden or 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 | |
| /** | |
| * Strong Blur | |
| * | |
| * @param resource $gdImageResource | |
| * @param int $blurFactor optional | |
| * This is the strength of the blur | |
| * 0 = no blur, 3 = default, anything over 5 is extremely blurred | |
| * @return GD image resource |
This file contains hidden or 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 | |
| $load = str_replace(',','.', trim(`uptime| awk '{print $10 }'`)); | |
| $cores = trim(`lscpu | grep "CPU(s):" | awk '{print $2}' | head -1`); | |
| $percent = $load/$cores * 100; | |
| echo $percent . '%'; |
This file contains hidden or 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
| <div class="wrap"> | |
| <h1>Style visited links with localStorage</h1> | |
| <h2>Why?</h2> | |
| <p> | |
| Since browsers allow only very basic CSS on <code>:visited</code> I created this way to check a user has clicked a link. If he clicks on any link, that has the class <code>.trackVisit</code> the complete href is saved in an array in localStorage. | |
| On each page visit and click on a link the script adds the class <code>.visited</code> so we can style it however we want. | |
| </p> | |
| <h2>Demo Links: Repo services</h2> | |
| <p> | |
| The links have <code>e.preventDefault();</code> - so you can click them hassle free ;) |
This file contains hidden or 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 | |
| $urls = [ | |
| 'http://www.flickr.com/services/feeds/photos_public.gne', | |
| 'https://i.stack.imgur.com/fgwQf.jpg', | |
| 'https://api.wordpress.org/secret-key/1.1/salt/', | |
| 'http://gabrielw.de', | |
| 'https://google.com', | |
| 'https://raw.githubusercontent.com/CodeBrauer/gmod-loadingscreen/master/img/bg.jpg', | |
| ]; |