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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.8.2 <0.9.0; | |
contract Lottery { | |
address public manager; | |
address payable[] public candidates; | |
address payable public winner; | |
constructor(){ |
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
(function() { | |
addEventListener("trix-initialize", function(e) { | |
const file_tools = document.querySelector(".trix-button-group--file-tools"); | |
file_tools.remove(); | |
}) | |
addEventListener("trix-file-accept", function(e) { | |
e.preventDefault(); | |
}) | |
})(); |
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
name: Flutter Build | |
on: | |
push: | |
branches: [ develop ] | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
build: |
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
xattr -cr App.app |
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
extension Date { | |
/// Returns a Date with the specified days added to the one it is called with | |
func add(years: Int = 0, months: Int = 0, days: Int = 0, hours: Int = 0, minutes: Int = 0, seconds: Int = 0) -> Date { | |
var targetDay: Date | |
targetDay = Calendar.current.date(byAdding: .year, value: years, to: self)! | |
targetDay = Calendar.current.date(byAdding: .month, value: months, to: targetDay)! | |
targetDay = Calendar.current.date(byAdding: .day, value: days, to: targetDay)! | |
targetDay = Calendar.current.date(byAdding: .hour, value: hours, to: targetDay)! | |
targetDay = Calendar.current.date(byAdding: .minute, value: minutes, to: targetDay)! |
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
Principal.identity().then(function (user) { | |
}); |
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
.state('example-detail', { | |
parent: 'entity', | |
url: '/example/{id}', | |
data: { | |
authorities: ['ROLE_USER'], | |
pageTitle: 'Example.example.detail.title' | |
}, | |
views: { | |
'content@': { | |
templateUrl: 'app/entities/example/example-detail.html', |
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
// | |
extension UIImageView { | |
func loadFromUrl(url: String?) { | |
if let url = url { | |
self.sd_setImageWithURL(NSURL(string: "\(url)")) | |
} | |
} | |
} |
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 | |
# | |
cd $(dirname "$0") | |
base=1024x1024.png | |
if [ -z $base ] | |
then | |
echo No argument given | |
else |
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
import UIKit | |
extension String { | |
subscript (r: CountableClosedRange<Int>) -> String { | |
get { | |
let startIndex = self.index(self.startIndex, offsetBy: r.lowerBound) | |
let endIndex = self.index(startIndex, offsetBy: r.upperBound - r.lowerBound) | |
return self[startIndex...endIndex] | |
} |
NewerOlder