Skip to content

Instantly share code, notes, and snippets.

View pb10005's full-sized avatar
😀
as usual

pb10001 pb10005

😀
as usual
View GitHub Profile
@pb10005
pb10005 / Vagrantfile
Created September 20, 2021 16:40
Rustの開発環境構築
$script = <<SCRIPT
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "generic/debian10"
config.vm.synced_folder "./volume", "/home/vagrant/app", create: true
config.vm.provision "shell", inline: $script, privileged: false
@pb10005
pb10005 / EditableHTML.md
Last active September 28, 2019 15:41
Toggle contenteditable

javascript:(function(){ document.getElementsByTagName("html")[0].contentEditable = true; })();

@pb10005
pb10005 / twitter.md
Last active March 7, 2019 09:58
ブックマークレット

旧Twitterで、タイムライン上にメディアツイートのみ表示する

javascript:(
  function(){
    var elms = document.getElementsByClassName("tweet"),
    for(var key in elms){
      var elm = elms[key];
      if(elm.getElementsByClassName("AdaptiveMedia").length === 0) {
        elm.style.display="none";
 }
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
public static void Main(){
// Your code here!
var N = int.Parse(Console.ReadLine());
var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
CountUp game = new CountUp(N, array);
game.Solve();

主なASCII文字の文字コード(10進数)

33~41はキーボードの順

コード 文字 備考
0 NUL null文字
10 LF 改行
32 スペース
33 !
34 "
@pb10005
pb10005 / 0brainfxxk.md
Last active July 21, 2018 09:01
Brainfxxk覚え書き
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static PB10004.Algorithm.Util;
namespace PB10004.Algorithm
{
-- 2つのリストの差を求める
difList::[Int]->[Int]->Int->[Int]
difList xs ys n = [(xs!!x) - (ys!!x)|x<-[0..n-1]]
readIntList::IO[Int]
readIntList = map read . words <$> getLine
-- IO Stringから整数のリストを読み込む
readArray::IO String -> IO[Int]
readArray = fmap $ map read . words
--Haskellでラムダ
--syntax sugar
mul = \x y -> x * y
mul' = \x -> \y -> x * y
main = do
--束縛せずに書ける
print $ (\x -> \y -> x*y) 4 5
--カリー化
@pb10005
pb10005 / Main.hs
Last active January 15, 2018 09:35
fizzbuzz:: [Int] -> String
fizzbuzz xs = f xs ""
where
f [] s = s
f (y:ys) s = f ys (s++show(fizzbuzzfunc y)++footer)
fizzbuzzfunc x = header x ++ fizz x ++ buzz x
header x = show(x) ++ ": "
fizz x | mod x 3 == 0 = "fizz"
| otherwise = ""