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 React from "react"; | |
import { | |
SafeAreaView, | |
ScrollView, | |
Text, | |
StyleSheet, | |
View, | |
Image, | |
Modal, | |
ImageSourcePropType, |
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 { Linking, Platform } from 'react-native'; | |
function _openMapLocationByAddress(){ | |
const url = Platform.select({ | |
ios: `maps:0,0?q=${address_string}`, | |
android: `geo:0,0?q=${address_string}`, | |
}) | |
Linking.openURL(url as string) | |
} |
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 | |
namespace App\Model; | |
class Merchant extends Model | |
{ | |
//... | |
/** | |
* scope "productAvailable()" that can be use for Merchant instance |
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 | |
use App\Http\Traits\StudentTrait; | |
class AnotherController extends Controller | |
{ | |
use StudentTrait; | |
/** |
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 | |
namespace App\Controller\AbsenceCalendarController; | |
class EmployeeAbsenceCalendar extends Controller | |
{ | |
protected $employee; | |
public function __construct(User $employee) |
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
const fileExtArr = ["png", "jpeg", "tft", "bmp", "jpg"]; | |
const maxFileSize = 4194587; | |
function validateUploadedFile(elementId) { | |
let fileElement = getElement(elementId); | |
const ext = fileUploadJson.docType || ""; | |
if (ext == "" || fileExtArr.indexOf(ext.toLowerCase()) < 0) | |
{ |
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
/* | |
WHAT: SublimeText-like Fuzzy Search | |
USAGE: | |
fuzzysort.single('fs', 'Fuzzy Search') // {score: -16} | |
fuzzysort.single('test', 'test') // {score: 0} | |
fuzzysort.single('doesnt exist', 'target') // null | |
fuzzysort.go('mr', ['Monitor.cpp', 'MeshRenderer.cpp']) | |
// [{score: -18, target: "MeshRenderer.cpp"}, {score: -6009, target: "Monitor.cpp"}] |
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
:: This is to .cbz archive 2 level deep folder containing images using WinRar CLI | |
:: Resulted Rar archieve then will be change format from .rar to .cbz | |
:: Archieved directory is removed by -dr flag | |
:: "C:\Program Files\WinRAR\RaR" is the installed WinRar Rar.exe directory | |
:: Use - Place this file at selected directory and run script. | |
FOR /d %%x IN (*.*) DO ( | |
cd "%%x" && ( | |
FOR /d %%y IN (*.*) DO ( |
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
/* | |
* Download .pem, connect SSH tunnel after set up Ubuntu instance. | |
* Open terminal and use following command | |
* This setup should more or less the same for any provider like DigitalOcean too. | |
*/ | |
$ ssh -i "your_pem.pem" ubuntu@<your public dns>.compute.amazonaws.com | |
/* | |
* the following command may need root privilage |
OlderNewer