Skip to content

Instantly share code, notes, and snippets.

View mh-mobile's full-sized avatar
🏠
Working from home

mh-mobile mh-mobile

🏠
Working from home
View GitHub Profile
@mh-mobile
mh-mobile / oneYearsCalculate.swift
Last active July 30, 2020 15:29
Swiftで「ある期間(1年間)の毎月1日」をDateオブジェクトを配列として取得するコード
import Foundation
let formatter = DateFormatter()
formatter.calendar = Calendar(identifier: .gregorian)
formatter.dateFormat = "yyyy/MM/dd"
let start = formatter.date(from: "2020/04/01")!
let days = (0..<12).map { month in
Calendar.current.date(byAdding: .month, value: month, to: start)!
}
const app = new Vue({
el: '#app',
data: {
editFriend: null,
friends: []
},
methods: {
deleteFriend(id, i) {
fetch("http://rest.learncode.academy/api/mh/friends/" + id, {
function myClass() {}
Object.defineProperty(myClass.prototype, "x", {
get() {
return this.store_x;
},
set(newValue) {
this.store_x = newValue;
},
});
class Target {
static use(plugin, options) {
plugin.install(Target, options)
}
methodA() {
console.log("call methodA")
}
}
class Target {
methodA() {
console.log("call methodA");
}
static include(mixin) {
Object.assign(this.prototype, mixin);
}
const inquirer = require("inquirer");
inquirer
.prompt([
{
name: "name",
message: "What's your name?",
default: "mh-mobile",
},
{
const Listr = require("listr");
const tasks = new Listr([
{
title: "Task1",
task: () => Promise.resolve("Foo"),
},
{
title: "Can be skipped",
skip: () => {
if (Math.random() > 0.5) {
const terminalImage = require("terminal-image");
(async () => {
console.log(await terminalImage.file("profile.png"));
})();
const logSymbols = require("log-symbols");
[
logSymbols.success,
logSymbols.info,
logSymbols.warning,
logSymbols.error,
].forEach(function (symbol) {
console.log(symbol, "symbol");
});