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
const clientsideDownloadFile = (blob,fileName) => { | |
// Test download attribute first | |
if ('download' in HTMLAnchorElement.prototype) { | |
// Create an object URL for the blob object | |
const url = URL.createObjectURL(blob); | |
// Create a new anchor element | |
const a = document.createElement('a'); | |
a.href = url; | |
a.download = fileName; |
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 { Injectable } from '@angular/core'; | |
import { AbstractControl } from '@angular/forms'; | |
@Injectable() | |
export class CustomValidators { | |
min(control: AbstractControl, value: number): { [key: string]: boolean } { | |
return control.value >= value ? null : { 'min': 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
import { Directive, forwardRef, Attribute, Injectable, ElementRef, Input } from '@angular/core'; | |
import { NG_VALIDATORS, Validator, AbstractControl, FormControl } from '@angular/forms'; | |
import { CustomValidators } from './customValidators'; | |
@Directive({ | |
selector: '[min][formControlName],[min][formControl],[min][ngModel]', | |
providers: [{ | |
provide: NG_VALIDATORS, | |
useExisting: forwardRef(() => MinValidator), | |
multi: 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
Public MustInherit Class TimeProvider | |
Private Shared _current As TimeProvider = DefaultTimeProvider.Instance | |
Public Shared Property Current As TimeProvider | |
Get | |
Return _current | |
End Get | |
Set | |
If Value Is Nothing Then |
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 string | |
sourceText = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." | |
input = "abcdefghijklmnopqrstuvwxyz" | |
map = "cdefghijklmnopqrstuvwxyzab" | |
trans = string.maketrans(input,map); | |
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 webbrowser | |
url = "http://www.pythonchallenge.com/pc/def/{0}.html" | |
newUrl = url.format(2**38) | |
print newUrl | |
webbrowser.open(newUrl) |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>ngFilters</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.1/css/foundation.css"> | |
</head> | |
<body> | |
<!--ng-app value matches Angular module string name in js file--> |
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
var myApp = angular.module('myApp', []); | |
myApp.factory('Avengers', function () { | |
var Avengers = {}; | |
Avengers.cast = [{ | |
name: "Robert Downey Jr.", | |
character: "Tony Stark / Iron Man" | |
}, | |
{ | |
name: "Chris Evans", |
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
using System.IO; | |
using Android.App; | |
using Android.Content; | |
using Android.Widget; | |
using Android.OS; | |
using TIG.Todo.Common; | |
using Android.Content.PM; | |
using TIG.Todo.Common.SQLite; | |
namespace TIG.Todo.AndroidApp |
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
using Android.App; | |
using Android.Content; | |
using Android.Support.V4.App; | |
using Android.Gms.Location; | |
using Android.Locations; | |
namespace TIG.Todo.AndroidApp | |
{ | |
[Service] |
NewerOlder