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
| export function Component() { | |
| const { ref } = useWhenViewed({ | |
| onInView: () => { | |
| // do cool things here | |
| }, | |
| }); | |
| return ( | |
| <div ref={ref}>Your content here</div> | |
| ); |
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
| body { | |
| white-space: pre; | |
| font-family: monospace; | |
| background-color: #011627; | |
| color: #d6deeb; | |
| } | |
| .property { | |
| font-weight: bold; | |
| color: #7fdbca; |
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
| Vue.mixin({ | |
| methods: { | |
| slugify(string) { | |
| if (typeof string !== 'undefined') { | |
| return string.toLowerCase() | |
| .replace(/[^\w ]+/g, '') | |
| .replace(/ +/g, '_'); | |
| } | |
| return string; |
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
| /* ==UserStyle== | |
| @name NOS Dark | |
| @namespace https://gist.github.com/jhammann/ | |
| @version 0.1.2 | |
| ==/UserStyle== */ | |
| @-moz-document domain("nos.nl") { | |
| body, | |
| body.homepage #most_viewed_videos, | |
| #menu-nieuws, |
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
| [].forEach.call(document.querySelectorAll('input'), function(el) { | |
| el.addEventListener('click', function() { | |
| //Check the attributes to see if one of them contains IMEI. | |
| var classes = el.getAttribute('class'); | |
| var id = el.getAttribute('id'); | |
| var name = el.getAttribute('name'); | |
| var attrStr = [classes, id, name].join(' ').toLowerCase(); | |
| if (attrStr.indexOf('imei') > -1) { | |
| el.value = generateImei(); |
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 geocodeSelectedCells() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var cells = sheet.getActiveRange(); | |
| if (cells.getNumColumns() != 4) { | |
| Logger.log("Must select the Street, City, Lat and Lng columns."); | |
| return; | |
| } | |
| var streetColumn = 1; |
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 | |
| // Scan the images directory, remove the folder indicators and reset the index. | |
| $files = array_values(array_diff(scandir('./images'), array('.', '..'))); | |
| // Get a random file from the array. | |
| $int = rand(0, (count($files) - 1)); | |
| $file = $files[$int]; | |
| // Serve the file as JPG content. |
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 | |
| header("Content-type: text/json"); | |
| header("Content-type: application/json"); | |
| // Add the username as a parameter to the URL: /?u=username | |
| $username = $_GET['u']; | |
| $url = 'https://www.instagram.com/' . $username; | |
| $ch = curl_init($url); |
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 | |
| header('Content-type: text/json'); | |
| header('Content-type: application/json'); | |
| $url = urldecode($_GET['url']); | |
| $ch = curl_init($url); | |
| curl_setopt($ch, CURLOPT_HEADER, true); | |
| curl_setopt($ch, CURLOPT_NOBODY, true); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); |
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
| # Git branch in prompt. | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| source /usr/local/git/contrib/completion/git-prompt.sh | |
| export GIT_PS1_SHOWDIRTYSTATE=1 | |
| PS1="\[\e[30;46m\] \u \[\e[0m\]\[\e[30;42m\] \W \[\e[0m\]\[\e[37;45m\]\$(__git_ps1 ' ⑂ %s ')\[\e[0m\] $ " |
NewerOlder