This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! -nargs=* Grep call Grep(<f-args>) | |
function! Grep(...) | |
let command = ["AsyncRun!", "rg", "--vimgrep", "--no-heading"] | |
call extend(command, a:000) | |
execute join(command) | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cmp; | |
//以下の配列は2019/7/1〜9/30までの最高気温の配列です。最も長い、30度を越えた連続日数を求めるプログラムを作成せよ | |
fn main() { | |
let temperatures = [25.7, 27.2, 26.3, 28.8, 30.5, 27.9, 29.5, 28.6, 28.5, 31.0, 24.8, 29.8, 26.3, 25.5, 29.2, 30.4, 30.3, 29.3, 26.3, 29.9, 30.3, 28.1, 32.0, 31.8, 32.1, 34.1, 29.1, 31.7, 32.9, 33.1, 34.8, 35.2, 36.5, 34.1, 33.0, 36.2, 34.9, 34.0, 32.3, 33.3, 34.5, 34.4, 36.7, 36.6, 35.6, 32.2, 31.2, 33.2, 33.7, 31.1, 30.6, 31.7, 31.9, 29.3, 28.9, 30.5, 29.6, 26.9, 27.5, 29.8, 28.2, 28.4, 29.0, 31.8, 31.2, 32.5, 33.2, 33.7, 34.7, 35.1, 32.3, 33.4, 32.7, 30.6, 26.9, 31.6, 32.5, 32.0, 31.9, 30.7, 27.6, 27.2, 25.1, 28.5, 28.9, 25.5, 28.4, 30.1, 29.2, 29.0, 29.9, 30.6]; | |
let mut count: i32 = 0; | |
let mut max: i32 = 0; | |
for t in temperatures.iter() { | |
if t > &30.0 { | |
count += 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs::File; | |
use std::io::prelude::*; | |
#[derive(Debug)] | |
struct Organization<'a> { | |
id: &'a str, | |
name: &'a str, | |
} | |
fn main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Standard Meta --> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
<!-- Site Properties --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Namespace Utils | |
Public Class BusyProcess | |
Implements IDisposable | |
Private form As Form | |
Public Sub New(form As Form) | |
Me.form = form | |
Me.form.Cursor = Cursors.WaitCursor | |
End Sub | |
Public Sub Dispose() Implements IDisposable.Dispose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=$(dirname $0) | |
backup_dir=$dir/../backup/crontab | |
mkdir -p $backup_dir | |
cp $backup_dir/crontab-backup $backup_dir/crontab-backup.1 | |
crontab -l > $backup_dir/crontab-backup | |
diff -Nu $backup_dir/crontab-backup.1 $backup_dir/crontab-backup >> $backup_dir/crontab-history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var execAfter = function(test, proc) { | |
var timer = setInterval(function(){ | |
if (test()) { | |
clearInterval(timer); | |
proc(); | |
return; | |
} | |
}, 500); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Data::Dumper; | |
die 'no argument.' if scalar @ARGV < 1; | |
my $check_path = $ARGV[0]; | |
my $uses = `fgrep -r 'use ' $check_path | sed -e 's/.*use \\([A-Z][a-zA-Z0-9:]\\+\\).*/\\1/' | grep -v '^/' | sort | uniq`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.ext' | xargs -n 1 perl -pi.bak -e 's/before string/after string/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.php; do n=${f%.*}; mv $n.php $n.tx; done; |