This file contains 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
//: # CSS linear-gradient to UIKit coordinate space conversion | |
import UIKit | |
import PlaygroundSupport | |
//handy radians | |
func radian(degree:Double) -> Double { return degree * Double.pi / 180 } | |
func radian(degree:CGFloat) -> CGFloat { return degree * CGFloat(Double.pi / 180) } | |
func gradientPoints(size:CGSize, cssAngle:CGFloat) -> (start:CGPoint, end:CGPoint) { |
This file contains 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 INNTests: XCTestCase { | |
override func setUp() { | |
super.setUp() | |
} | |
override func tearDown() { | |
super.tearDown() | |
} | |
func testInn() { | |
func checkInn(_ inn:String) -> Bool { | |
let len = inn.count |
This file contains 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
<script>function%20r(e,t){return%20e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}const%20m=r(7,10),nextY=(new%20Date).getFullYear()+1,d=r(1,28),options={year:"numeric",month:"long",day:"numeric"},firstPeriod=[new%20Date(nextY,m,d),new%20Date(nextY,m,d+14)].map(e=>e.toLocaleDateString("ru-RU",options)).join("%20-%20"),m2=r(2,6),d2=r(1,28),secondPeriod=[new%20Date(nextY,m2,d2),new%20Date(nextY,m2,d2+14)].map(e=>e.toLocaleDateString("ru-RU",options)).join("%20-%20");document.writeln(`${firstPeriod}<br>${secondPeriod}`);</script> |
This file contains 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
// Google may setup some restrictions for a massive requests per seconds. | |
// So you need planning to run script multiple times | |
var SEARCH_QUERY = '!label:Parsed_by_Script'; | |
// The Main func - entry point | |
function gmailExportToSpreadsheet(){ | |
// we | |
for (var index = 0; index <= 2000; index += 100){ | |
parseEmailMessages(index); | |
Logger.log("Parsed next %s messages.", index); |
This file contains 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 | |
# This script fix issue for unexpected not appearing the eth0 interface on the Raspberry Pi 3. | |
# The script is fixing the name of ethernet interface to 'eth0' persistently. | |
cd /etc/udev/rules.d/ | |
touch 70-persistent-net.rules | |
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="smsc95xx", ATTR{address}=="*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"' >> 70-persistent-net.rules |