This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:
index.ts
contains the Cloud Functions code, and dialog.ts
contains the script to run
class Solution { | |
func fib(_ N: Int) -> Int { | |
return self.recursiveWay(N) | |
} | |
func recursiveWay(_ N: Int) -> Int { | |
if N == 0 { return 0 } |
This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:
index.ts
contains the Cloud Functions code, and dialog.ts
contains the script to run
extension String { | |
public func isPhone()->Bool { | |
if self.isAllDigits() == true { | |
let phoneRegex = "[235689][0-9]{6}([0-9]{3})?" | |
let predicate = NSPredicate(format: "SELF MATCHES %@", phoneRegex) | |
return predicate.evaluate(with: self) | |
}else { | |
return false | |
} |
import UIKit | |
class NRLabel : UILabel { | |
var textInsets = UIEdgeInsets.zero { | |
didSet { invalidateIntrinsicContentSize() } | |
} | |
override func textRect(forBounds bounds: CGRect, limitedToNumberOfLines numberOfLines: Int) -> CGRect { | |
let insetRect = UIEdgeInsetsInsetRect(bounds, textInsets) |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
public class Constellation_main { | |
public static void main(String[] args) { | |
System.out.println(getConstellationFromDate("10/01")); | |
} | |
private static String getConstellationFromDate(String strBirthday) { | |
int intBirthday = Integer.valueOf(strBirthday.replace("/","")); | |
if (intBirthday < 11 | intBirthday > 1231) { |
<div ng-app="wizardApp"> | |
<div ng-controller="WizardSignupController"> | |
<h2>Signup wizard</h2> | |
<div ui-view></div> | |
</div> | |
</div> | |
<script type="text/javascript" src="/js/vendor/angular-ui-router/release/angular-ui-router.min.js"></script> | |
<script type="text/javascript"> | |
angular.module('wizardApp', [ | |
'ui.router', |
angular.module('d3', []) | |
.factory('d3Service', ['$document', '$window', '$q', '$rootScope', | |
function($document, $window, $q, $rootScope) { | |
var d = $q.defer(), | |
d3service = { | |
d3: function() { return d.promise; } | |
}; | |
function onScriptLoad() { | |
// Load client in the browser | |
$rootScope.$apply(function() { d.resolve($window.d3); }); |