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 | |
//returns a big old hunk of JSON from a non-private IG account page. | |
function scrape_insta($username) { | |
$insta_source = file_get_contents('http://instagram.com/'.$username); | |
$shards = explode('window._sharedData = ', $insta_source); | |
$insta_json = explode(';</script>', $shards[1]); | |
$insta_array = json_decode($insta_json[0], TRUE); | |
return $insta_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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Handle Front Controller... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.html [L] | |
</IfModule> |
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 { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-dashboard', | |
template: `{{ online }}`, | |
}) | |
export class DashboardComponent implements OnInit { | |
online = navigator.onLine; | |
constructor() { |
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
products = [ | |
{ | |
harga: 549813, | |
berat: 26 | |
}, | |
{ | |
harga: 522586, | |
berat: 39 | |
}, | |
{ |
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
<table style="width:100%" border="1"> | |
<tr> | |
<th>Harga Produk</th> | |
<th>Jumlah Produk</th> | |
</tr> | |
<tr *ngFor="let product of products"> | |
<td>{{ product.harga }}</td> | |
<td>{{ product.berat }}</td> | |
</tr> | |
</table> |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'harga' | |
}) | |
export class HargaPipe implements PipeTransform { | |
transform(value: any): any { | |
return 'Rp. '+ value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); | |
} |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'berat' | |
}) | |
export class BeratPipe implements PipeTransform { | |
transform(value: any, ...args: any[]): any { | |
return value + ' kg'; | |
} |
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 { HargaPipe } from './harga.pipe'; | |
import { BeratPipe } from './berat.pipe'; | |
@NgModule({ | |
declarations: [ | |
....... | |
HargaPipe, | |
BeratPipe, | |
], |
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
<tr *ngFor="let product of products"> | |
<td>{{ product.harga | harga }}</td> | |
<td>{{ product.berat | berat }}</td> | |
</tr> |
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
{ | |
"fullname": "John Doe", | |
"address": "Giriwoyo, Wonogiri, Jawa Tengah", | |
"phone": "0812234345456", | |
"gender": "male", | |
"birthdate": "1995-08-04", | |
"smoking": false, | |
"interest": ["business", "programming", "life lesson", "future"], | |
"family": [ | |
{ |
OlderNewer