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
$('*').each(function () { | |
var colors = ['aqua', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple', 'red', 'silver', 'teal', 'yellow']; | |
$(this).css('background-color', colors[Math.floor(Math.random()*colors.length)]); | |
$(this).css('font-family', 'Comic Sans MS'); | |
}); | |
$('img').each(function () { | |
var imgs = [ | |
'http://www.animatedgif.net/devilish/coolskul.gif', | |
'http://www.animatedgif.net/devilish/devildance_e0.gif', |
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
$('*').each(function () { | |
var colors = ['aqua', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple', 'red', 'silver', 'teal', 'yellow']; | |
$(this).css('background-color', colors[Math.floor(Math.random()*colors.length)]); | |
$(this).css('font-family', 'Comic Sans MS'); | |
}); | |
$('img').each(function () { | |
var imgs = [ | |
'http://www.animatedgif.net/devilish/coolskul.gif', | |
'http://www.animatedgif.net/devilish/devildance_e0.gif', |
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
'use strict'; | |
var i = 0 | |
, names = [] // add names here | |
, len = (names.length / 2); | |
function matchPair () { | |
return selectName() + ' & ' + selectName(); | |
} |
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 MongoAPI{ | |
private $db; | |
private $col; | |
private $apiKey; | |
public function __construct($db,$col,$apiKey){ | |
$this->db = $db; | |
$this->col = $col; |
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
// Post repeat directive for logging the rendering time | |
angular.module('myApp').directive('postRepeatDirective', | |
['$timeout', | |
function($timeout) { | |
return function(scope) { | |
if (scope.$first) | |
window.a = new Date(); // window.a can be updated anywhere if to reset counter at some action if ng-repeat is not getting started from $first | |
if (scope.$last) | |
$timeout(function(){ | |
console.log("## DOM rendering list took: " + (new Date() - window.a) + " ms"); |
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
# This is a sample build configuration for PHP. | |
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: phpunit/phpunit:5.0.3 | |
pipelines: | |
default: | |
- step: |
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 { Response, RequestOptions, ConnectionBackend } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { Storage } from '@ionic/storage'; | |
import { HttpAuthInterceptor, InterceptorConfig } from './http-auth-interceptor'; | |
export class HttpAuth extends HttpAuthInterceptor { | |
// In production code do not put your API keys here make sure they are obtained some other way. | |
// perhaps a env variables. |
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
export function getHttpAuth(backend: ConnectionBackend, defaultOptions: RequestOptions, storage: Storage) { | |
return new HttpAuth(backend, defaultOptions, storage); | |
} | |
@NgModule({ | |
... | |
providers: [ | |
{ |
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 { Http, Request, RequestOptions, RequestOptionsArgs, Response, ConnectionBackend, Headers } from "@angular/http"; | |
import { Observable } from "rxjs/Observable"; | |
import "rxjs/add/observable/fromPromise"; | |
import "rxjs/add/operator/mergeMap"; | |
export interface InterceptorConfigOptional { | |
headerName?: string; | |
headerPrefix?: string; | |
noTokenError?: boolean; | |
} |
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
function getPhoto() { | |
navigator.camera.getPicture(onPhotoSuccess, onPhotoFail, | |
{quality: 70, targetWidth: 500, targetHeight: 500, | |
sourceType: navigator.camera.SourceType.PHOTOLIBRARY, | |
destinationType: navigator.camera.DestinationType.FILE_URI, | |
}); | |
} | |
function onPhotoSuccess(imageUri) { | |
var $img = $('<img/>'); |
OlderNewer