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
blueprint: | |
name: Motion-activated Switch | |
description: Turn on a Switch when motion is detected. | |
domain: automation | |
author: edwardmp | |
input: | |
motion_entity: | |
name: Motion Sensor | |
selector: | |
entity: |
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
require 'faraday' # HTTP Client | |
require 'faraday-cookie_jar' | |
require 'faraday_middleware' | |
require 'fastlane/version' | |
require 'logger' | |
require 'spaceship/babosa_fix' | |
require 'spaceship/helper/net_http_generic_request' | |
require 'spaceship/helper/plist_middleware' | |
require 'spaceship/ui' | |
require 'tmpdir' |
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
~ $ fastlane env | |
[20:15:10]: Generating fastlane environment output, this might take a few seconds... | |
<details><summary>🚫 fastlane environment 🚫</summary> | |
### Stack | |
| Key | Value | | |
| --------------------------- | ---------------------------------------------------------------- | | |
| OS | debian_based stretch/sid | | |
| Ruby | 2.4.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
BootstrapForm::FormBuilder.class_eval do | |
def association_object(name) | |
name = name.to_s | |
if name.end_with?('_ids') | |
# Check for a has_(and_belongs_to_)many association (these always use the _ids postfix field). | |
association = object.class.reflect_on_association(name.chomp('_ids').pluralize.to_sym) | |
else | |
# Check for a belongs_to association with method_name matching the foreign key column | |
association = object.class.reflect_on_all_associations.find do |a| |
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
{ | |
"aps":{ | |
"alert":{ | |
"body":"The status of flight KL123 scheduled 20:30 to London Heathrow has changed to 'boarding'. Boarding at 20:05.", | |
"title":"Boarding at 20:05" | |
}, | |
"category":"openFlightCategory" | |
}, | |
} |
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 eu.sig.aevas; | |
import eu.sig.aevas.dependencymanager.maven.MavenDependency; | |
import org.apache.commons.io.FileUtils; | |
import org.apache.commons.lang3.StringUtils; | |
import org.apache.log4j.Logger; | |
import org.eclipse.jdt.core.JavaCore; | |
import org.eclipse.jdt.core.dom.*; | |
import java.io.File; |
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 ( | |
"io" | |
"os" | |
"strings" | |
) | |
type rot13Reader struct { | |
r io.Reader |
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 Foundation | |
class ViewController: UIViewController, NSURLSessionDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
httpGet(NSMutableURLRequest(URL: NSURL(string: "https://example.com")!)) | |
} |
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
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler | |
{ | |
completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); | |
} |
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
/* | |
1. Adhere to the NSURLSessionDelegate delegate | |
2. Initialize NSURLSession and specify self as delegate (e.g. [NSURLSession sessionWithConfiguration:defaultConfigObject delegate:self delegateQueue: [NSOperationQueue mainQueue]];) | |
3. Add the method below to your class | |
4. Change the certificate resource name | |
*/ | |
- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler | |
{ | |
SecTrustRef serverTrust = challenge.protectionSpace.serverTrust; |
NewerOlder