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
| String.prototype.rJust = function(padLen, padStr) { | |
| return (new Array(padLen).join(padStr) + this.valueOf()).slice(-padLen); | |
| }; | |
| String.prototype.lJust = function(padLen, padStr) { | |
| return (this.valueOf() + new Array(padLen).join(padStr)).substring(0, padLen); | |
| }; | |
| /** | |
| * > "6969".lJust(10, "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
| git for-each-ref --sort='-committerdate' --format='%(committerdate) -/- %(objectname:short) -/- %(refname:short) -/- %(subject)' refs/heads |
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
| users_data = [{ | |
| "id": "7c5dae5552338874e5053f2534d2767a", | |
| "email": "user@example.com", | |
| "first_name": "John", | |
| "last_name": "Appleseed", | |
| "username": "cfuser12345", | |
| "telephone": "+1 123-123-1234", | |
| "country": "US", | |
| "zipcode": "12345", | |
| "created_on": "2014-01-01T05:20:00Z", |
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
| class LunarDate { | |
| final int year; | |
| final int month; | |
| final int day; | |
| final int leapMonth; | |
| final bool isLeapYear; | |
| /// Constructs a [LunarDate] instance. | |
| LunarDate(this.year, this.month, this.day, [this.isLeapYear = false, this.leapMonth = 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
| import 'package:flutter/material.dart'; | |
| class IpDetail extends StatelessWidget { | |
| final String ipAddr; | |
| final List<String> ipDomains; | |
| IpDetail(this.ipAddr, this.ipDomains); | |
| @override | |
| Widget build(BuildContext context) { |
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
| #!/usr/bin/env bash | |
| function get_time_format() { | |
| time_str_formatted=$(TZ="Asia/Tokyo" date +"$1") | |
| echo "$time_str_formatted" | |
| } | |
| function init_log_file() { | |
| if [[ ! -f "$1" ]]; then |
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
| #!/usr/bin/env bash | |
| sidekiqProcessNumber=$(ps ax | grep -i [s]idekiq | wc -l) | |
| pumaProcessNumber=$(ps ax | grep -i [p]uma | wc -l) | |
| function pushWarningMessage() | |
| { | |
| serverIP=$(hostname -i) | |
| jpTime=$(TZ=":Asia/Tokyo" date +"%Y/%m/%d %H:%M:%S") | |
| vnTime=$(TZ=":Asia/Ho_Chi_Minh" date +"%Y/%m/%d %H:%M:%S") |
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
| program gaCho; | |
| uses | |
| crt; | |
| var | |
| chanGa, chanCho, soGa, soCho, i: integer; | |
| begin | |
| clrscr; | |
| soCho := 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
| # encoding: UTF-8 | |
| require "nokogiri" | |
| require "open-uri" | |
| require "terminal-table" | |
| require "csv" | |
| table_headings = ["STT", "Mã BC", "Tên Bưu cục", "BC cấp", "Địa chỉ", "Điện thoại"] | |
| province = ARGV[0] | |
| document = Nokogiri::HTML(open("https://inxpress360.com/ma-buu-dien-#{province}/")) |