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
| import httplib | |
| import socket | |
| import StringIO | |
| # generic | |
| SSDP_ALL = 'ssdp:all' | |
| UPNP_ROOT = 'upnp:rootdevice' | |
| # devices | |
| DIAL = 'urn:dial-multiscreen-org:service:dial: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
| const randomNumber = (min, max) => Math.floor(Math.random() * (max - min + 1) + min); | |
| const randomByte = () => randomNumber(0, 255) | |
| const randomPercent = () => (randomNumber(50, 100) * 0.01).toFixed(2) | |
| const randomCssRgba = () => `rgba(${[randomByte(), randomByte(), randomByte(), randomPercent()].join(',')})` |
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
| #!/bin/bash | |
| set -euo pipefail | |
| function myFunction() { | |
| myCommand | |
| return $? | |
| } | |
| retry=0 | |
| maxRetries=5 |
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
| // Refer to https://gist.github.com/remy/350433 | |
| try { | |
| // Test webstorage existence. | |
| if (!window.localStorage || !window.sessionStorage) throw "exception"; | |
| // Test webstorage accessibility - Needed for Safari private browsing. | |
| localStorage.setItem('storage_test', 1); | |
| localStorage.removeItem('storage_test'); | |
| } catch(e) { | |
| (function () { | |
| var Storage = function (type) { |
In React's terminology, there are five core types that are important to distinguish:
React Elements
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
| /////////////////////////////////////////////////////////// | |
| // Plain SASS Trigonometry Algorithm in Taylor Expansion // | |
| // // | |
| // Based on // | |
| // http://japborst.net/posts/sass-sines-and-cosines // | |
| /////////////////////////////////////////////////////////// | |
| $pi: 3.14159265359; | |
| $_precision: 10; |
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
| // NOTICE 2020-04-18 | |
| // Please see the comments below about why this is not a great PRNG. | |
| // Read summary by @bryc here: | |
| // https://github.com/bryc/code/blob/master/jshash/PRNGs.md | |
| // Have a look at js-arbit which uses Alea: | |
| // https://github.com/blixt/js-arbit | |
| /** |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);