Skip to content

Instantly share code, notes, and snippets.

@zaengit
zaengit / index.php
Last active December 8, 2018 16:12
view media instagram
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
use Illuminate\Support\Facades\Storage;
public function removeImage($file){
$checkImage = Storage::disk(env('DRIVER_FILE_SYSTEM'))->exists(env('PATH_FTP_IMAGE') . $file);
$checkThumbnail = Storage::disk(env('DRIVER_FILE_SYSTEM'))->exists(env('PATH_FTP_THUMBNAIL') . $file);
if ($checkImage) {
Storage::disk(env('DRIVER_FILE_SYSTEM'))->delete(env('PATH_FTP_IMAGE') . $file);
}
if ($checkThumbnail) {
const search = [2, 3, 5]
const arr = [1, 2, 3, 4, 5, 3]
const = arr.filter(item => search.includes(item))
console.log(const)
// [ 2, 3, 5 ]
state = {
text: 'text di sini'
}
callFirstName = ()=> {
return new Promise((resolve) => {
setTimeout(()=> {
resolve('Zainal')
}, 1000)
})
def FindText(text, f, space = 100):
tf = f
find = text.find(tf)
if (find > -1):
cl = 0
if ((find - space) > 0):
cl = find - space
else:
const findText = (text, f, space = 100) => {
let tf = f
let find = text.search(tf)
if (find > -1){
let cl = 0
if ((find - space) > 0){
cl = find - space
} else {
cl = 0
<template>
<div class="hello">
<pdf
v-for="i in numPages"
:key="i"
:src="src"
:page="i"
></pdf>
{{ numPages }}
<button @click="numPages += 1">tambah</button>
755 folder
644 file
sudo find directory/ -type d -exec chmod 755 {} \; (only directory)
Sudo find directory/ -type f -exec chmod 644 {} \; (only file)
read/write laravel
-----------------------------------------
chmod -R ug+rwx storage bootstrap/cache
var express = require('express');
var router = express.Router();
const tf = require('@tensorflow/tfjs');
const mobilenet = require('@tensorflow-models/mobilenet');
const tfnode = require('@tensorflow/tfjs-node');
const fs = require('fs');
const readImage = path => {
const imageBuffer = fs.readFileSync(path);
require 'jwt'
key_file = 'key.txt'
team_id = 'xxx'
client_id = 'com.example.app'
key_id = '123'
ecdsa_key = OpenSSL::PKey::EC.new IO.read key_file
headers = {