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
| x.sort((a, b) => z(a) > z(b)) | |
| function z(str) { | |
| return (<h4 style="text-align: center;">)[A-Za-z\,\s]+(<\/h4>)/.exec(str)[0].replace('<h4 style="text-align: center;">', '').replace('</h4>', '').replace(', CA', '') | |
| } |
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
| { | |
| "id": 1, | |
| "name": "sample 1", | |
| "child": [ | |
| { | |
| "id": 12, | |
| "name": "sample 12", | |
| "child": [], | |
| "parentId": 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
| var els = Array.from( | |
| document.querySelectorAll(".rls-info-container .link-1080p .hs-magnet-link a") | |
| ); | |
| var links = '' | |
| for (let i = 0; i < els.length; i++) { | |
| var prefix = i === 0 ? '' : '\n\n' | |
| var magnet = els[i]; | |
| links += `${prefix}${magnet.href}` |
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
| /* @flow */ | |
| /** | |
| * Chunks an array in a specific pattern | |
| * @example chunkPattern(['haha', 'haha', 'haha', 'haha', 'haha', 'haha', 'haha', 'haha', 'haha'], [2, 3]) | |
| * @return Array<Array<*>> | |
| */ | |
| function chunkPattern(array: Array<*>, pattern: Array<number>): Array<Array<*>> { | |
| const result: Array<Array<*>> = [] |
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/xml" | |
| "fmt" | |
| ) | |
| const data = `<?xml version="1.0" encoding="utf-8"?> | |
| <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
| <soap:Body> |
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 ( | |
| "bytes" | |
| "regexp" | |
| "encoding/json" | |
| ) | |
| type PascalSnakeMarshaller struct { | |
| Value interface{} |
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 ( | |
| "time" | |
| ) | |
| func nowWithGivenTime(hour int, minutes int) (time.Time, error) { | |
| today := time.Now() | |
| l, err := time.LoadLocation("Local") | |
| if err != nil { |
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 ( | |
| "strconv" | |
| "strings" | |
| ) | |
| func parseTime(t string) (int, int) { | |
| split := strings.Split(t, " ") | |
| time := split[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
| package main | |
| import ( | |
| "strings" | |
| "regexp" | |
| ) | |
| func getThumbnailFromStyle(style string) string { | |
| r := regexp.MustCompile("url\\((.+)\\)") | |
| return strings.TrimRight(strings.TrimLeft(r.FindString(style), "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
| <DataTable endpoint="api.myapp.com/users"> | |
| <DataTable.Column> | |
| {(data) => | |
| <span>{data.firstName} {data.lastName}</span> | |
| )} | |
| </DataTable.Column> | |
| <DataTable.Column> | |
| {(data) => | |
| <a href={`/user/${data.id}`}>View</a> |