Skip to content

Instantly share code, notes, and snippets.

View keisukeYamagishi's full-sized avatar
:octocat:
easygoing 🍣

keisukeYamagishi keisukeYamagishi

:octocat:
easygoing 🍣
View GitHub Profile
@keisukeYamagishi
keisukeYamagishi / ContentView.swift
Last active March 8, 2024 03:32
Markdown-SwiftUI
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Text("`Hello, world!`")
@keisukeYamagishi
keisukeYamagishi / Reference.swift
Last active October 23, 2023 07:51
A reference method for 'self' that doesn't use either weak references or non-owning references
import Foundation
class Closures {
let memberVariable = "member"
let memberVariable2 = "member2"
func execute() {
closures { [self] in
a=['ボ','ン','ボ','ン','ジョ','ヴィ']
b=0
str=''
cou=0
loop{
c=rand(6)+1
str=a[c]
print str
cou+=1
if [ -z `which hogehoge` ]; then
echo "The command you specified does not exist.🤷🏻‍♂️"
fi
/*
MIT License
Copyright (c) RxSwiftCommunity
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
extension String {
func compareVersion(version: String) -> Bool {
let versions = version.components(separatedBy: ".")
let selfVersion = components(separatedBy: ".")
for index in 0 ..< versions.count {
var isGreaterThan = false
if versions[index] <= selfVersion[index] {
isGreaterThan = true
}
if !isGreaterThan {
//
// main.cpp
// Seiki
//
// Created by Shichimitoucarashi on 2020/07/12.
// Copyright © 2020 keisukeYamagishi. All rights reserved.
//
#include <iostream>
#include <regex>
@keisukeYamagishi
keisukeYamagishi / permutation.rb
Created February 9, 2020 16:06
順列の計算式を記録
def pattern (items, pattern)
(fact 4) / (fact (items.count - pattern))
end
#階乗
def fact(n, a=1)
return a if n == 0
fact(n-1, n*a)
end
var token = String(format: "%@", deviceToken as CVarArg) as String
let characterSet: CharacterSet = CharacterSet.init(charactersIn: "<>")
token = token.trimmingCharacters(in: characterSet)
token = token.replacingOccurrences(of: " ", with: "")
print("deviceToken: \(token)")
def dupli (d)
uniqDups = d.uniq
dups = Array.new
uniqDups.each { |e|
if d.grep(e).size > 1
dups.push(e)
end
}
return dups