Skip to content

Instantly share code, notes, and snippets.

View aero's full-sized avatar

aero aero

  • Seoul, Republic of Korea
View GitHub Profile
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active April 22, 2024 09:01
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^

아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.

1. 마크다운에 관하여

@msoap
msoap / script.go
Last active October 8, 2022 17:23
Run Go program as script
//usr/bin/env go run $0 "$@"; exit
package main
import (
"fmt"
"os"
)
func main() {
fmt.Println("Hello world!")
@calid
calid / 00-preamble.md
Last active October 3, 2022 10:45
ZeroMQ Perl Performance Comparison: FFI vs XS bindings

ØMQ Perl Performance Comparison: FFI vs XS bindings

Comparison of the performance of FFI vs XS zeromq bindings. For FFI the ZMQ::FFI bindings are used, first using FFI::Raw on the backend and then using FFI::Platypus. For XS ZMQ::LibZMQ3 is used.

Comparison is done using the zeromq weather station example, first by timing wuclient.pl using the various implementations, and then by profiling wuserver.pl using Devel::NYTProf. When profiling the server is changed to simply publish 1 million messages and exit.

@kfly8
kfly8 / bbs.pl
Created February 28, 2015 07:06
Perl入学式 #6 の掲示板の練習問題で、DBに記事を格納する形にしてみる
#!/usr/bin/env perl
use Mojolicious::Lite;
use DBIx::Sunny;
app->attr(dbh => sub { DBIx::Sunny->connect('dbi:mysql:dbname=bbs', 'root','') });
get '/' => sub {
my $c = shift;
my $entries = app->dbh->select_all('SELECT * FROM entry');
@xiongchiamiov
xiongchiamiov / activate
Last active January 30, 2017 17:32 — forked from rahulg/activate
export GOPATH="$(builtin cd "$(dirname "${BASH_SOURCE[0]:-$_}" )" && pwd)"
export OLDPS1=$PS1
export PS1="[go:$(basename $GOPATH)] $PS1"
alias gcd="cd $GOPATH"
deactivate() {
export PS1=$OLDPS1
unset GOPATH
unset OLDPS1
unalias gcd
unset deactivate
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@dwarring
dwarring / gist:6127599
Last active December 20, 2015 11:59
perl6 brainf*ck program
use v6;
grammar Brainfuck::Grammar {
rule TOP {^ [<cmd> || .+? ]* $}
proto token cmd { <...> }
token cmd:sym<ptr-inc> {\>}
token cmd:sym<ptr-dec> {\<}
token cmd:sym<inc> {\+}
token cmd:sym<dec> {\-}
token cmd:sym<input> {\,}
@krimdomu
krimdomu / gist:6080102
Created July 25, 2013 14:15
rex and expect
# Rexfile
use Expect;
set connection => "OpenSSH";
my $expect_timeout = 5;
my $git_password = 'f00b4r';
my $sudo_password = 'test';
@tsee
tsee / terrain.h
Created April 25, 2013 17:53
terrain.h - a naive C implementation
#define NW 0
#define NE 1
#define SW 2
#define SE 3
#include <math.h>
#include <limits.h>
#include <stdlib.h>
#include <EXTERN.h>
use Plack::App::CGIBin;
use Plack::App::PHPCGI;
use Plack::Builder;
use File::Zglob;
my $cgibin = Plack::App::CGIBin->new(
root => "/usr/local/nagios/sbin",
exec_cb => sub { my $file = shift; $file =~ m!\.cgi$! and -x $file },
)->to_app;
my $static = Plack::App::File->new(root => "/usr/local/nagios/share")->to_app;