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 path = require('path'); | |
console.log(path.dirname(require.main.filename)); |
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
function isUpperCase(letter){ | |
let l = letter.charCodeAt(); | |
return l >= 65 && l <= 90; | |
} | |
function isLowerCase(letter){ | |
let l = letter.charCodeAt(); | |
return l >= 97 && l <= 122; |
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 pyqrcode | |
data = input('Please enter some text or link to generate QR code : ') | |
qr = pyqrcode.create(data) | |
qr.svg('qrcode.svg', scale=8) |
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
'1,2'.split(',').map(a => "'" + a.replace("'", "''") + "'").join() |
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
randomize() { | |
var letters = '0123456789ABCDEF'; | |
var color = '#'; | |
for (var i = 0; i < 6; i++) { | |
color += letters[Math.floor(Math.random() * 16)]; | |
} | |
return color; | |
} |
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 class AsciiValue { | |
public static void main(String[] args) { | |
int x; | |
for (x = 0; x <= 255; x++) { | |
System.out.println("The ASCII value of " + String.format("%c", x) + " is: " + String.format("%d", x)); | |
} | |
} | |
} |
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.Calendar; | |
import java.util.Formatter; | |
import java.util.Locale; | |
import java.text.SimpleDateFormat; | |
public class DateFormaterPlayGround | |
{ | |
String locale = "id"; | |
public static void main(String[] args) |
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
docker run --name mysql -itd --restart=always \ | |
--env="MYSQL_ROOT_PASSWORD=toor" \ | |
--volume /srv/docker/mysql:/var/lib/mysql \ | |
--publish 3306:3306 \ | |
mysql:5.7 |
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
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
"net/http" | |
) | |
type Person struct { | |
ID string `uri:"id" binding:"required,uuid"` | |
Name string `uri:"name" binding:"required"` |
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
-- DDL | |
-- Create | |
CREATE TABLE `users` (`id` bigint unsigned not null auto_increment primary key, | |
`name` varchar(255) not null, | |
`email` varchar(255) not null, | |
`email_verified_at` timestamp null, | |
`password` varchar(255) not null, | |
`remember_token` varchar(100) null, | |
`created_at` timestamp null, |