Skip to content

Instantly share code, notes, and snippets.

View mugifly's full-sized avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
@mugifly
mugifly / gist-clone-ssh.pl
Last active December 26, 2015 11:59
Gist ssh-clone script (git clone via ssh)
#! /usr/bin/env perl
# Gist ssh-clone script
# Help: $ perl git-clone-ssh.pl --help
# (c) Masanori Ohgita (http://ohgita.info/) - 2013, MIT License.
use warnings;
use strict;
use utf8;
use File::Basename qw//;

redcaretとgithub-markdownの違い

  • 両者のソースは割りと似ている(github-markdownがredcarpetを元にしたのか、あるいは両者のもとになったC実装があるとかかな)

オプションについて

github-markdownは、redcapetの提供するオプションの一部をデフォルトで有効化します。 (ちなみに有効化するオプションを選ぶAPIはない模様。用途を考えるとそれで正しいが)

★がついているのが有効化されるもの。gfmモード(.render_gfmメソッド)の場合のみ、★★も有効化される。

@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gsainio
gsainio / gist:6322375
Created August 23, 2013 18:20
Sample perl code to use service accounts and oauth2 with Google's Admin SDK API.
#!/usr/public/bin/perl -w
use strict;
use JSON;
use JSON::WebToken;
use LWP::UserAgent;
use HTML::Entities;
my $private_key_string = q[-----BEGIN PRIVATE KEY-----
@focusaurus
focusaurus / ep_app.js
Last active June 14, 2022 00:06
Example of how a main express app can mount sub-applications on a mount point with app.use('/mount-point', subapp); If you GET /, you'll see the main_app's '/' response. If you GET /ep_app, you'll see the ep_app's '/' response.
const express = require("express");
const router = express.Router();
router.get('/', function (req, res) {
res.send("This is the '/' route in ep_app");
});
module.exports = router;

Niigata.ll 発表(?)資料 「Perl なめんな」

猫型です。Niigata.llの開催おめでとうございます。行けなくてくやしいです。資料だけここに公開します。タイトルは「Perlなめんな」です。dis られがちなオブジェクトシステムと例外機構の貧弱さについて現代的な Perl の視点から回答します。

「Perl は可読性が〜」とか 「Perl はオブジェクトシステムがぶっ壊れてる〜」とかうるせえよ CPAN なめんなって話

「素のPerlのオブジェクトシステムは貧弱すぎる」。その通りです、でも Mouse とかを使えば結構素直に書けるのです。

Mouseってなに

@mugifly
mugifly / daemon.pl
Created January 23, 2013 16:50
How to use the Morbo (include Mojolicious) as a simple http daemon. For example, it will be useful for doing development with XMLHTTPRequest(Javascript) on localhost.
#!/usr/bin/env perl
use Mojolicious::Lite;
push @{app->static->paths}, 'site/'; # File path
app->start('daemon');
# Execute this script on terminal: perl daemon.pl
# Then, let's access to http://localhost:3000/***
@teppeis
teppeis / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

for i in `git branch -r|grep -v HEAD|grep -v master|sed 's:origin/::g'`
do
git checkout --track -b $i origin/$i
done
git checkout master