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
| var pr = new Promise(function(resolve, reject) { | |
| var fn = function(event) { | |
| console.log("Event type: %s, Event target.readyState: %d, Event target.status: %d, Event target.statusText: %s", | |
| event.type, | |
| event.target.readyState, | |
| event.target.status, | |
| event.target.statusText | |
| ); | |
| if (event.type == "error" || event.type == "abort" || (event.type == "load" && (event.target.readyState != XMLHttpRequest.DONE || event.target.status != 200))) { |
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
| var test = (function() { | |
| _this = 'test'; | |
| return function() { | |
| console.log(_this); | |
| }; | |
| })(); | |
| (function() { | |
| _this = 'another'; |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Message struct { | |
| Data 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
| CaseConversion | |
| Bracket Highlighter | |
| Sidebar Enchancements | |
| HTML/CSS/JS Prettify | |
| Emmet |
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
| package main | |
| import ("fmt"; "time") | |
| func main() { | |
| var distance float64 = 10.0 | |
| var speed float64 = 3.0 | |
| val := distance / speed * 1000000000 | |
| duration := time.Duration(val) |
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 | |
| cd /path/to/project | |
| while [ 1 ]; do | |
| inotifywait --exclude '.git' -r -e modify,moved_to,moved_from,move,create,delete ./ | |
| rsync -ah --exclude='.git/' ./ server:/dev/shm/projectname/ --delete | |
| done | |
| exit 0 |
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
| resp.Content.Headers.ContentType <- MediaTypeHeaderValue.Parse "application/json" | |
| // OR | |
| resp.Content.Headers.Remove("Content-Type") |> ignore | |
| resp.Content.Headers.Add("Content-Type", "application/json") | |
| // Because Content-Type header has HttpHeaderKind.Content and there is an exception while setting | |
| // it on response itself: | |
| // resp.Headers.Add("Content-Type", "application/json") |
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
| let print (slots:(int * string * string * string * int * string) list) (token: string) = | |
| // (article_id * slot_id * hash * realHash * options_count * slot_title) | |
| [ | |
| "By title and hash:\n" | |
| slots | |
| |> List.groupBy (fun slot -> | |
| let articleId, slotId, slotHash, slotRealHash, optionsCount, title = slot | |
| title | |
| ) | |
| |> List.map (fun (title, entries) -> |
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
| ┌─────┬──────┐ | |
| │ │ │ | |
| ├─────┼──────┤ | |
| │ │ │ | |
| └─────┴──────┘ | |
| ╔═════╦══════╗ | |
| ║ ║ ║ | |
| ╠═════╬══════╣ | |
| ║ ║ ║ |
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
| <link rel="icon" href="data:;base64,iVBORw0KGgo="> |
OlderNewer