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 generate(s){ | |
| var temp = new Array(); | |
| temp = s.split('\n'); | |
| temp.sort(); | |
| var result = ""; | |
| var i; | |
| for(i=0; i<temp.length; i++) { | |
| result += temp[i] + "\n"; | |
| } | |
| return result; |
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 getDateTime() { | |
| var now = new Date(); | |
| var year = now.getFullYear(); | |
| var month = now.getMonth()+1; | |
| var day = now.getDate(); | |
| var hour = now.getHours(); | |
| var minute = now.getMinutes(); | |
| var second = now.getSeconds(); | |
| if(month.toString().length == 1) { | |
| var month = '0'+month; |
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 renumber(s) { | |
| var rgx=/^\d+\. /m, | |
| list=s.split(rgx), | |
| count; | |
| list.shift(); | |
| count = list.length; | |
| for(var i=0; i<count; i++) { | |
| list[i] = (i+1).toString() + '. ' + list[i]; | |
| } | |
| return list.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
| [[[title]]][1]: | |
| > [[selection]] | |
| [1]: [[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
| import UIKit | |
| import PlaygroundSupport | |
| let vc = UIViewController() | |
| vc.view.backgroundColor = .white | |
| PlaygroundPage.current.liveView = vc | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| let button = UIButton(type: .system) | |
| button.frame = CGRect(x: 0, y: 0, width: 240, height: 120) |
OlderNewer