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 followUser($user_id, $tw_username_to_follow) | |
{ | |
$response_array = array(); | |
$tmhOAuth = new tmhOAuth(array( | |
'consumer_key' => TWITTER_CONSUMER_KEY, | |
'consumer_secret' => TWITTER_CONSUMER_SECRET, | |
)); | |
$response_array = array( |
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 makeid(length) | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for(var i=0; i < length; i++) | |
{ | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
} |
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, Inject, Optional, Type} from '@angular/core'; | |
import {HammerGestureConfig} from '@angular/platform-browser'; | |
import {MAT_HAMMER_OPTIONS} from '@angular/material/core'; | |
/** | |
* Noop hammer instance that is used when an instance is requested, but | |
* Hammer has not been loaded on the page yet. | |
*/ | |
const noopHammerInstance = { | |
on: () => {}, |
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
<div class="product-expanded-details col-5 col-lg-6" *ngIf="(_mode === 'expanded')"> | |
<!-- Conditional template Outlet (see: https://stackoverflow.com/a/52448001/1116959) --> | |
<ng-container *ngTemplateOutlet="_product?.highlighted ? highlightedDetails : normalDetails; context: { product: _product }"> | |
</ng-container> | |
</div> | |
</div> | |
<!-- Product - Normal Details template --> | |
<ng-template #normalDetails let-product="product"> | |
<div class="variant-details" *ngIf="product?.type === 'single' || product?.type === 'multi'"> |
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 | |
// Given any image url, it uploads to amazon s3 | |
function UploadImageURL() | |
{ | |
// $image_url = (isset($_REQUEST["image_url"]) && $_REQUEST["image_url"]!=null) ? $_REQUEST["image_url"] : null; | |
$image_url = "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-prn1/t1/p526x296/1965014_10153859707455111_1422873058_n.jpg"; | |
// $image_url = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIWFRQBAwQEBgUGCgYGChAODA0QFA8OEAwNDQ8QDw0ODhANEA8MDA8PDxAQFA4VDw8PDhANDQ4ODRAQDw8UDhAMDA0MDP/AABEIACwALAMBEQACEQEDEQH/xAAaAAADAAMBAAAAAAAAAAAAAAAHCAkDBQYE/8QANBAAAQMDAwMCAwUJAQAAAAAAAQIDBAUGEQAHIQgSMRNBFCJxFzJCYYEVFiM0Q1FTcpEJ/8QAGgEAAgMBAQAAAAAAAAAAAAAAAwQABQYCAf/EACsRAAEDAwIEBQUBAAAAAAAAAAEAAgMREjEEIRNBUfBxgZGhwQUUImHRsf/aAAwDAQACEQMRAD8AfZtXA0wuFnR51FKrX3jd1N29s2uXRWFqbpVFgvVCUpsZV6baCtQSPdRAwB7kjUUUO7yvW/uszeebcc1Dji1r7I8NtwmPTI/4Gkk8ADyTgFSsnydIT6hkQq4+ATmn0z5zaweJ5BF66+gLcyltQbkiINXSyhC3YkBKlyEYGThJyFeM8YGST76Wh1okdu0jompdAWD8XA9e |
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
// See: https://www.learnrxjs.io/operators/combination/forkjoin.html | |
// Added take(1) bc of this behaviour: https://github.com/angular/angularfire2/issues/617#issuecomment-255513958 | |
forkJoin( | |
this.firebaseService.getUserEventsForDevice(selectedDevice.key, filterCriteria).pipe(take(1)), | |
this.firebaseService.getEventsFromDevice(selectedDevice.key, filterCriteria).pipe(take(1)) | |
) | |
.subscribe( | |
([userEvents, deviceEvents]) => { | |
console.log('userEvents', userEvents); | |
console.log('deviceEvents', deviceEvents); |
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 express = require('express'), | |
app = express(); | |
app.use(express.static('dist/browser')); | |
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests | |
app.all('*', function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "X-Requested-With"); | |
next(); |
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
{ | |
"name": "mobile-ui-design-client", | |
"version": "1.0.0", | |
"description": "A simple starter Angular2 project", | |
"scripts": { | |
"build": "rimraf dist && webpack --progress", | |
"watch": "npm run build -- --watch", | |
"server": "webpack-dev-server --inline --progress --port 3000 --content-base src", | |
"start-dev": "npm run server", | |
"prestart": "npm run build", |
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 retailers_urlGet = "http://booking.com"; | |
// Lets get retailers from backend API | |
appAPI.request.get(retailers_urlGet, | |
function(response, responseHeaders) | |
{ | |
// Need to get these params from the response | |
var src = $(response).find("input[name=src]").val(), | |
error_url = $(response).find("input[name=error_url]").val(), | |
dcid = $(response).find("input[name=dcid]").val(), |
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 face_cropper = (function(){ | |
var crop_faces = function(rects, sc, max, imageObj, imageType){ | |
var on = rects.length; | |
if(on && max) | |
{ | |
jsfeat.math.qsort(rects, 0, on-1, function(a,b){return (b.confidence<a.confidence);}) | |
} | |
var n = max || on; | |
n = Math.min(n, on); |
NewerOlder