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 { ElectronService } from "ngx-electron"; | |
@Injectable() | |
export class CardReaderService { | |
constructor(private electron: ElectronService) {} | |
getData() { | |
return new Promise((resolve, reject) => { | |
if (!this.electron.isElectronApp) { |
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 { Directive, HostListener, ElementRef } from '@angular/core'; | |
import { DecimalPipe } from '@angular/common'; | |
@Directive({ | |
selector: 'input[type="text"][decimalOnly]' | |
}) | |
export class DecimalOnlyDirective { | |
private decimalRegEx = /^\d+\.?(\d{1,2})?$/; | |
private allowedKeys: Array<string> = [ | |
'Enter', 'Backspace', 'Tab', 'Delete', |
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
daemon off; | |
worker_processes 1; | |
events { worker_connections 1024; } | |
http{ | |
sendfile on; |
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
#!/bin/bash | |
# Functions ============================================== | |
# return 1 if global command line program installed, else 0 | |
# example | |
# echo "node: $(program_is_installed node)" | |
function program_is_installed { | |
# set to 1 initially | |
local return_=1 |
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 java.util.*; | |
class Main { | |
public static void main(String args[]) { | |
int arr[] = new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13,14}; | |
fn1(arr, 4); | |
fn2(arr, 4); | |
} |
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
Show hidden characters
{ | |
"presets": ["react", "es2015"] | |
} |
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 java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import java.util.Map; | |
import java.util.HashMap; | |
public class RegexMatches { | |
public static void main(String args[]) { | |
Map<String, String> mapData = new HashMap<String, String>(); | |
mapData.put("NAME", "Ronnakorn"); |
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
public void saveUpload() { | |
try { | |
MultiPartRequestWrapper multiWrapper = (MultiPartRequestWrapper) ServletActionContext.getRequest(); | |
String[] fileName = multiWrapper.getFileNames("file"); | |
for(String s : fileName) { | |
System.out.println(s); | |
} | |
// Get a Files[] object for the uploaded File |
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 test1 = [ | |
{ | |
"id" : 1, | |
"name" : "test1" | |
}, | |
{ | |
"id" : 2, | |
"name" : "test2" | |
}, | |
{ |
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
spring.datasource.driverClassName = com.mysql.jdbc.Driver | |
spring.datasource.url = jdbc:mysql://localhost/ชื่อฐานข้อมูล | |
spring.datasource.username = root | |
spring.datasource.password = รหัสผ่าน | |
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect | |
spring.jpa.hibernate.ddl-auto = create-drop |
NewerOlder