Skip to content

Instantly share code, notes, and snippets.

@nissuk
nissuk / _.php
Last active November 26, 2020 03:58
PHP: Noticeエラーを回避してarrayから値を取得するいくつかの例
<?php
error_reporting(E_ALL);
// 通常の取得
// 配列のキーに値がない場合、Notice: Undefined index が発生します。
$foo = $_GET['foo'];
$bar = $_GET['bar'];
$baz = $_GET['baz'];
@noahhendrix
noahhendrix / api.rb
Created December 22, 2011 09:38
Authenticating with Grape
module Todo
class API < Grape::API
use Rack::Session::Cookie
version 'v1', :format => :json
helpers do
def current_user
return nil if env['rack.session'][:user_id].nil?
@current_user ||= User.get(env['rack.session'][:user_id])
end
@ympbyc
ympbyc / FunctionalJs.md
Last active April 26, 2023 12:26
Functional JavaScript

Functional JavaScript

2013 Minori Yamashita ympby@gmail.com

-- ここにあなたの名前を追記 --

目次

@maxim
maxim / task.yml
Created June 12, 2014 11:09
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
@hzm-s
hzm-s / mixin.go
Last active April 13, 2022 10:50
mixin with golang
package main
import "fmt"
// 料理を作るI/F
type Cooker interface {
Cook() string
}
// 塗るI/F
@uupaa
uupaa / fp.now.md
Last active May 25, 2022 11:58
いまどきのガラケー事情

いまどきのガラケーと Flash Lite 開発事情

いまどきのガラケーコーディングがどうなっているか確認してみました。

ガラケーを取り巻く環境の変化

  • 停波による古い端末の一掃
    • docomo
      • 2006春モデル以前の端末が mova の停波により 2012/03/31 から利用不能に
  • au
@roachhd
roachhd / README.md
Last active June 16, 2024 15:17
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@hiroyuki-sato
hiroyuki-sato / gist:ec502a7e37ae488e4256
Last active September 3, 2020 15:51
Embulk組み込みアウトプット覚書

Embulk組み込みアウトプット覚書

ここに記載している情報は間違えている可能性があります。ご注意ください。

元ネタ なんちゃって個人情報をembulkで使う

Embulkアウトプットプラグイン覚書

設定例

@halberom
halberom / 00_description
Last active April 14, 2022 19:23
ansible - example of using filters to change each item in a list
The problem:
I wanted to use the jinja 'map' filter to modify each item in a string, in this simple
example, adding '.conf' to each item.
The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately,
it uses 'value' as the pattern. When called inside map 'value' is the current item in
the list, or in other words *args as far as format is concerned. So it's the wrong way
around.
@mtdtks
mtdtks / cVimrc.vim
Last active March 31, 2019 16:40
chromeのcVimの社内用セッティング
"==={general}===
let scrollstep = 150
let fullpagescrollpercent = 100
"set nohud
"set autohidecursor
"eで検索窓へ
map e goToInput
"open link in new tab (active)