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
| String.prototype.html = function() { | |
| let parser = new DOMParser(); | |
| let doc = parser.parseFromString(this, "text/html"); | |
| return doc.body.firstChild; | |
| }; |
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
| class Component extends HTMLElement { | |
| constructor() { | |
| super(); | |
| } | |
| connectedCallback() { | |
| const height = this.clientHeight, | |
| width = this.clientWidth; | |
| this.createSvg(); |
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
| sudo dpkg -i --force-overwrite /var/cache/apt/archives/libgl1-mesa-glx_1%3a17.3~git170828152300.63e79a8~z~padoka0_amd64.deb |
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
| selectObject(event) { | |
| event.preventDefault(); | |
| let vector = new THREE.Vector3( | |
| event.clientX / window.innerWidth * 2 - 1, | |
| -(event.clientY / window.innerHeight) * 2 + 1, | |
| 0.5 | |
| ); | |
| vector = vector.unproject(this.camera); | |
| const raycaster = new THREE.Raycaster( |
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
| { | |
| "accessors": { | |
| "accessors_0": { | |
| "bufferView": "bufferViews_3", | |
| "byteOffset": 0, | |
| "byteStride": 2, | |
| "componentType": 5123, | |
| "count": 855, | |
| "max": [ | |
| 246 |
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
| <html> | |
| <head> | |
| <title>WebSocket demo</title> | |
| </head> | |
| <body> | |
| <div> | |
| <form> | |
| <label for="numberfield">Number</label> | |
| <input type="text" id="numberfield" placeholder="12"/><br /> |
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 xml.etree.ElementTree | |
| ''' | |
| Classifier - array layout: | |
| [width, height, threshold, num_simple_classifiers, tilted, num_features, f1, f2, f3, f4, f_weight, simple_threshold, left_val, right, val, ...] | |
| ''' | |
| wrapper = "(function(module) {\n" + \ | |
| " \"use strict\";\n" + \ | |
| " \n" + \ |
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
| #![allow(dead_code)] | |
| struct Car { | |
| name: String, | |
| seats: i32, | |
| speed: i32, | |
| } | |
| impl Car { | |
| fn drive(&self) { | |
| println!("{name} drives at speed: {speed} km/h", speed = self.speed, name = self.name); |
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 names = ['Mike', 'Matt', 'Nancy', 'Adam', 'Jenny', 'Nancy', 'Carl'] | |
| const count = names => | |
| names.reduce((a, b) => | |
| Object.assign(a, {[b]: (a[b] || 0) + 1}), {}) | |
| const duplicates = dict => | |
| Object.keys(dict).filter((a) => dict[a] > 1) | |
| console.log(count(names)) // { Mike: 1, Matt: 1, Nancy: 2, Adam: 1, Jenny: 1, Carl: 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
| server { | |
| listen 443 ssl; | |
| server_name url.pw www.url.pw; | |
| ssl_certificate /etc/letsencrypt/live/scarystories.pw/fullchain.pem; | |
| ssl_certificate_key /etc/letsencrypt/live/scarystories.pw/privkey.pem; | |
| ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |