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 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"> |
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
| 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) { |
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 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 ] |
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
| state = { | |
| text: 'text di sini' | |
| } | |
| callFirstName = ()=> { | |
| return new Promise((resolve) => { | |
| setTimeout(()=> { | |
| resolve('Zainal') | |
| }, 1000) | |
| }) |
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
| 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: |
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 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 |
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
| <template> | |
| <div class="hello"> | |
| v-for="i in numPages" | |
| :key="i" | |
| :src="src" | |
| :page="i" | |
| ></pdf> | |
| {{ numPages }} | |
| <button @click="numPages += 1">tambah</button> |
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
| 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 |
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 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); |
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
| 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 = { |
OlderNewer