Skip to content

Instantly share code, notes, and snippets.

View azrsh's full-sized avatar

azarashi azrsh

  • University of Tsukuba
  • Tsukuba
View GitHub Profile
using System;
class Program
{
//Level k の時のpの数を格納
static readonly long[] dp = new long[51];
static readonly long[] lengthDp = new long[51];
static void SetDP(int n, int i)
{
using System;
namespace Azarashi.Utilities.Collections
{
public static class ArrayExtension
{
public static void ForEach<T>(this T[] array, Func<int, T, T> func)
{
for (int i = 0; i < array.Length; i++)
array[i] = func(i, array[i]);
@azrsh
azrsh / arduino_pwm_frequency_change.cpp
Created March 16, 2019 00:02
Arduinoのpwm出力の周波数を変更する
TCCR2B = (TCCR2B & 0b11111000) | 0x01; //Timer2の周波数を変更
TCCR3B = (TCCR2B & 0b11111000) | 0x01; //Timer3の周波数を変更
TCCR4B = (TCCR2B & 0b11111000) | 0x01; //Timer4の周波数を変更
@azrsh
azrsh / arduino_pwm_frequency_change.cpp
Created March 16, 2019 00:02
Arduinoのpwm出力の周波数を変更する
TCCR2B = (TCCR2B & 0b11111000) | 0x01; //Timer2の周波数を変更
TCCR3B = (TCCR2B & 0b11111000) | 0x01; //Timer3の周波数を変更
TCCR4B = (TCCR2B & 0b11111000) | 0x01; //Timer4の周波数を変更
const std = @import("std");
pub fn main() anyerror!void {
std.debug.warn("Congratulations on your first step to writing perfect software in Zen.\n");
}
@azrsh
azrsh / keybase.md
Created April 30, 2021 04:17
keybase.md

Keybase proof

I hereby claim:

  • I am azarashi2931 on github.
  • I am azarashi2931 (https://keybase.io/azarashi2931) on keybase.
  • I have a public key whose fingerprint is A0C0 FC1E 3D4A BE36 59F0 D831 E91C 1653 EDEB 8F88

To claim this, I am signing this object:

@azrsh
azrsh / main.c
Last active June 18, 2021 08:21
elf_header_dump
#include <elf.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
// parse argument
if (argc != 2) {
return 1;
}
@azrsh
azrsh / main.c
Last active June 18, 2021 08:21
section_header_table_dump
#include <elf.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
// parse argument
if (argc != 2) {
return 1;
}
@azrsh
azrsh / wl_sum.js
Last active July 25, 2021 09:40
Amazon の WishList の総額出し太郎
(() => {
const reducer = (accumulator, currentValue) => accumulator + currentValue;
const items = Array.from(document.getElementById("wl-item-view").getElementsByClassName("a-price-whole"))
.map(item => item.innerHTML.replace(",", ""))
.map(str => parseInt(str));
const total = items.reduce(reducer);
return items.length.toLocaleString() + " items, " + total.toLocaleString() + " yen"
})();
@azrsh
azrsh / dry-run-renovate.md
Last active October 20, 2022 06:02
Dry run renovate on the custom branch

Renovate CLI options to use renovate.json on the custom branch

yarn global add renovate
RENOVATE_TOKEN='<GitHub Personal Access Token>' LOG_LEVEL=debug RENOVATE_BASE_BRANCHES='<custome-branch>' \
  renovate <owner>/<repository> \
  --dry-run \
  --use-base-branch-config 'merge'