原文:程序人生
今个谈谈 erlang。我之前谈过不少语言:
elixir:灵丹妙药?or 徒有其名?
Javascript: 世纪机器语言?
golang五周岁。
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { |
| git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }' | |
原文:程序人生
今个谈谈 erlang。我之前谈过不少语言:
elixir:灵丹妙药?or 徒有其名?
Javascript: 世纪机器语言?
golang五周岁。
| /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app="http://www.google.de" |
| #!/bin/bash | |
| # This gist contains pre-commit hooks to prevent you from commiting bad code or to the wrong branch. | |
| # There are six variants that I have built: | |
| # - pre-commit: stops commits to master/main/develop branches. | |
| # - pre-commit-2: also includes a core.whitespace check. | |
| # - pre-commit-3: the core.whitespace check and an EOF-newline-check. | |
| # - pre-commit-4: only the core.whitespace check. | |
| # - pre-commit-5: elixir formatting check. | |
| # - pre-commit-6: prettier formatting check. | |
| # Set the desired version like this before proceeding: |
| #!/bin/bash | |
| # Collects system performance statistics such as CPU, memory, and disk | |
| # usage as well as top processes ran by users. | |
| # | |
| # All size values are in KiB (memory, disk, etc). | |
| # Takes these command line arguments: | |
| # $1 - cpuThreshold in % of total across all CPUs. Default is provided in no-args option. |
| #!/usr/bin/env bash | |
| # Kill an Erlang process by node name | |
| # | |
| # e.g.: kill-erlang-node kred | |
| # Check usage | |
| if [ -z "$1" ]; then | |
| echo "Usage: `basename $0` NODE_NAME" | |
| exit 1 |
| #!/usr/bin/env perl | |
| use File::Path qw(make_path); | |
| use File::Spec; | |
| use strict; | |
| use warnings; | |
| @ARGV || die 'Must provide repository information as an argument'; | |
| my $raw = $ARGV[0]; |
| # Add the following 'help' target to your Makefile | |
| # And add help text after each target name starting with '\#\#' | |
| help: ## Show this help. | |
| @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
| # Everything below is an example | |
| target00: ## This message will show up when typing 'make help' | |
| @echo does nothing |