This file contains hidden or 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
Model | |
public function scopeDistance($subQuery, $latitude, $longitude, $distance) | |
{ | |
//Generating Query | |
$item_distance_query = '* , (3959 * ' . | |
'acos( cos( radians(?) ) ' . //lat | |
'* cos( radians( lat ) ) ' . | |
'* cos( radians( lng ) - radians(?) ) ' . //long | |
'+ sin( radians(?) ) ' . //lat |
This file contains hidden or 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
"cmd.exe" /k set CMDER_ROOT=C:\cmder&&set ConEmuDir=%CMDER_ROOT%\vendor\conemu-maximus5&&call "%CMDER_ROOT%\vendor\init.bat" |
This file contains hidden or 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 gulp = require('gulp'); | |
const sass = require('gulp-sass'); | |
const concat = require('gulp-concat'); | |
const uglify = require('gulp-uglify'); | |
const imagemin = require('gulp-imagemin'); | |
const pngquant = require('imagemin-pngquant'); | |
const htmlmin = require('gulp-htmlmin'); | |
const browserSync = require('browser-sync').create(); | |
This file contains hidden or 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 {BrowserModule} from '@angular/platform-browser'; | |
import {NgModule} from '@angular/core'; | |
import {JwtModule, JWT_OPTIONS} from '@auth0/angular-jwt'; | |
export function jwtFactory(authService) { | |
return { | |
whitelistedDomains: [ | |
new RegExp('localhost:8000/*'), |
This file contains hidden or 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 {HttpClient} from "@angular/common/http"; | |
import {Cep} from './cep'; | |
import {map} from 'rxjs/operators'; | |
@Injectable() | |
export class CepService { | |
constructor(private http:HttpClient) { } |
This file contains hidden or 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 { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt'; | |
import { AuthorizationService } from './authorization.service'; | |
import { environment } from '../../environments/environment'; | |
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; | |
import { RefreshTokenInterceptor } from './refresh-token-interceptor'; | |
function jwtOptionsFactory (authorizationService: AuthorizationService) { | |
return { |
This file contains hidden or 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
@NgModule({ | |
providers: [ | |
{ | |
provide: HTTP_INTERCEPTORS, | |
useClass: TokenInterceptorService, | |
multi: true | |
}, | |
{ | |
provide: HTTP_INTERCEPTORS, |
This file contains hidden or 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
#!/usr/bin/env node | |
// each object in the array consists of a key which refers to the source and | |
// the value which is the destination. | |
const filestocopy = [ | |
{ | |
"./icons/drawable-hdpi/ic_stat_school.png": [ | |
"./platforms/android/app/src/main/res/drawable-land-hdpi/ic_stat_school.png", | |
"./platforms/android/app/src/main/res/drawable-port-hdpi/ic_stat_school.png", | |
], |
This file contains hidden or 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> | |
<body> | |
<p>Looping through arrays inside arrays.</p> | |
<p id="demo"></p> | |
<script> | |
var myObj, i, j, x = ""; |
This file contains hidden or 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 anchors = document.querySelectorAll('div.classe>a'); | |
for (var key in anchors){ | |
anchors[key].setAttribute('target', '_blank'); | |
} |