Skip to content

Instantly share code, notes, and snippets.

View perforb's full-sized avatar

Yusuke Maeda perforb

View GitHub Profile
@perforb
perforb / development.pl
Last active November 4, 2023 13:53
Easily import the settings in Perl.
+{
mysql => {
user => 'volt',
password => 'voltisfast',
},
}
@perforb
perforb / Tweets Importer
Last active September 16, 2019 19:12
Tweets Importer - Imports your tweets to MySQL.
create database tweets_importer character set utf8;
create table user_timeline(
id int(10) auto_increment
,uid int(10) not null
,name varchar(255) not null
,text varchar(255) not null
,source varchar(255) not null
,retweet_count int(10) not null
,favorited int(1) not null
,retweeted int(1) not null
@perforb
perforb / config.yml
Created January 28, 2019 03:52
example of config.yml
# Sample 2.0 config.yml Files
# https://circleci.com/docs/2.0/sample-config/
# https://circleci.com/docs/2.0/language-java/
version: 2.1
executors:
default:
docker:
- image: circleci/openjdk:11-jdk-browsers
environment:
public static void main(String[] args) {
Instant instant = Instant.ofEpochMilli(System.currentTimeMillis());
String timeZone1 = ZoneId.SHORT_IDS.get("CST");
String timeZone2 = ZoneId.SHORT_IDS.get("JST");
String timeZone3 = "UTC";
ZonedDateTime zonedDateTime1 = ZonedDateTime.ofInstant(instant, ZoneId.of(timeZone1));
ZonedDateTime zonedDateTime2 = ZonedDateTime.ofInstant(instant, ZoneId.of(timeZone2));
ZonedDateTime zonedDateTime3 = ZonedDateTime.ofInstant(instant, ZoneId.of(timeZone3));
System.out.println(String.format("%2s:%2s %s", zonedDateTime1.getHour(), zonedDateTime1.getMinute(), zonedDateTime1));
package com.example.todo.library.datetime;
import java.time.Clock;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;
import java.util.Objects;
package com.example.todo.common.datetime;
import java.time.Clock;
import java.time.ZoneId;
import java.time.ZonedDateTime;
public class ClockTimeTest {
public static void main(String[] args) {
Clock utc = Clock.systemUTC();
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
def make_dictionary(source_path):
with open(source_path, encoding='utf-8') as fh:
tuples = []
for line in fh:
package jp.co.serialgames.pitacchi.tool;
import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom;
public class QuickSort {
private static char[] getAlphabets() {
int i = 0;
char[] alphabets = new char[26];
package algorithm;
import java.util.Arrays;
public class BubbleSort
{
public static void main(String[] args)
{
int[] ints = {23220, 82319, 22, 9023090, 239, 11634};
boolean flag = false;
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.