Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
install: | |
- if [[ $TRAVIS_PHP_VERSION = nightly ]]; then export COMPOSER_FLAGS="--ignore-platform-reqs"; fi | |
- travis_retry composer update --prefer-dist $COMPOSER_FLAGS |
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 Bundle { | |
func decode<T: Decodable>(_ type: T.Type, from filename: String) -> T { | |
guard let json = url(forResource: filename, withExtension: nil) else { | |
fatalError("Failed to locate \(filename) in app bundle.") | |
} | |
guard let jsonData = try? Data(contentsOf: json) else { | |
fatalError("Failed to load \(filename) from app bundle.") | |
} |
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 UIApplication { | |
class func openAppSettings() { | |
guard let url = URL(string: self.openSettingsURLString) else { return } | |
self.shared.open(url, options: [:], completionHandler: nil) | |
} | |
class func openSubscriptionManagement() { | |
guard let url = URL(string: "itms://apps.apple.com/account/subscriptions") else { return } | |
self.shared.open(url, options: [:], completionHandler: nil) | |
} |
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
<?php class Sports_Bench_Team_REST_Controller extends WP_REST_Controller { | |
/** | |
* Register the routes for the objects of the controller. | |
*/ | |
public function register_routes() { | |
$namespace = 'sportsbench'; | |
$base = 'teams'; | |
register_rest_route( $namespace, '/' . $base, array( | |
array( |
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
#!/usr/bin/ruby | |
# | |
# Usage: | |
# ruby ./merge_dna_files.rb file,file1,file2... > merged_file.txt | |
# | |
# Example: | |
# ruby ./merge_dna_files.rb AncestryDNA.txt genome_John_Doe_v4_Full_20170428065226.txt > merged_raw.txt | |
# | |
# Supports 23andMe, AncestryDNA, and Genes for Good 23andMe compatible file formats. | |
# The result will be in 23andMe file format. |
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
<?php declare(strict_types = 1); | |
function testPerformance($name, Closure $closure, $runs = 1000000) | |
{ | |
$start = microtime(true); | |
for (; $runs > 0; $runs--) | |
{ | |
$closure(); | |
} | |
$end = microtime(true); |
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
# LVDB - LLOOGG Memory DB | |
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]> | |
# All Rights Reserved | |
# TODO | |
# - cron with cleanup of timedout clients, automatic dump | |
# - the dump should use array startsearch to write it line by line | |
# and may just use gets to read element by element and load the whole state. | |
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
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
$INPUTVIDEO='input.mp4' | |
$OUTPUTVIDEO='output.mp4' | |
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO |
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
<?php | |
<<<CONFIG | |
packages: | |
- "kriswallsmith/buzz: ^0.15.0" | |
- "symfony/console: ^3.2@dev" | |
CONFIG; | |
// Find you token on https://api.slack.com/docs/oauth-test-tokens | |
use Buzz\Message\Response; |
NewerOlder