import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var textField: UITextField!
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
xcode_proj=`find . -name "*.xc*" -d 1 | sort -r | head -1` | |
if [ `echo -n $xcode_proj | wc -m` == 0 ] | |
then | |
echo "No xcworkspace/xcodeproj file found in the current directory." | |
exit 1 | |
fi | |
echo "Found $xcode_proj" | |
open $xcode_proj |
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
// From: http://www.bdunagan.com/2009/11/28/iphone-tip-no-nshost/ | |
// MIT license | |
// Remember to add CFNetwork.framework to your project using Add=>Existing Frameworks. | |
#import "BDHost.h" | |
#import <CFNetwork/CFNetwork.h> | |
#import <netinet/in.h> | |
#import <netdb.h> | |
#import <ifaddrs.h> |
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/sh | |
date=$1 | |
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do | |
if [[ "$(git log $branch --since $date | wc -l)" -eq 0 ]]; then | |
if [[ "$branch" =~ "origin/" ]]; then | |
local_branch_name=$(echo "$branch" | sed 's/^origin\///') | |
if [[ "$DRY_RUN" -eq 1 ]]; then | |
echo "git push origin :$local_branch_name" |
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 FancyBackgroundApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Stack( | |
children: <Widget>[ | |
Positioned.fill(child: AnimatedBackground()), | |
onBottom(AnimatedWave( | |
height: 180, | |
speed: 1.0, | |
)), |
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 'dart:ui' as ui; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; | |
import 'package:flutter/services.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
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 { Amplify, Auth, withSSRContext } from 'aws-amplify' | |
import { Auth as NuxtAuth } from '@nuxtjs/auth-next' | |
export interface AmplifyAuthSchemeOptions { | |
name: string | |
} | |
export default class AmplifyAuthScheme { | |
public $auth: NuxtAuth | |
public options: AmplifyAuthSchemeOptions |
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/zsh | |
# Workaround for https://github.com/docker/for-mac/issues/5310 | |
VERSION=14.0.0 # set version here | |
cd /tmp | |
git clone git@github.com:keycloak/keycloak-containers.git | |
cd keycloak-containers/server | |
git checkout $VERSION |
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
on: | |
push: | |
branches: | |
- master | |
name: Build and Release Apps | |
jobs: | |
build: | |
name: Build Apps | |
runs-on: macos-latest |
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 | |
/// Struct identifying a Feature Flag that is used to enable/disable access to a feature | |
/// | |
/// example: | |
/// ``` | |
/// // Only allow this feature on iPhones in the US if the flag is enabled | |
/// let featureFlag = FeatureFlag(name: "EnableMyFeature", localeRestrictions: ["en_US"], deviceTypes: [.phone]) | |
/// guard featureFlag.isEnabled else { return } | |
/// ``` |