Skip to content

Instantly share code, notes, and snippets.

View yucao24hours's full-sized avatar
🎀
Learning DNS

Yuka Kato yucao24hours

🎀
Learning DNS
View GitHub Profile
@gaearon
gaearon / modern_js.md
Last active April 14, 2025 19:22
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active April 17, 2025 11:00
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
class Hoge
def combination(array, num)
if array.empty? || num == 0
[]
elsif num == 1
array.map{ |elem| [elem] }
else
rest = array.drop(1)
combination(rest, num - 1).map{ |elem| [array.first] + elem } +
combination(rest, num)
@joker1007
joker1007 / Dockerfile
Last active July 4, 2022 13:55
Sample Dockerfile for rails app
FROM appbase
# install npm & bower packages
WORKDIR /root
COPY package.json bower.json /root/
RUN npm install --only=prod && \
npm cache clean && \
bower install --allow-root
# install gems
@kunitoo
kunitoo / README.md
Last active May 6, 2016 09:33
ESM オフラインリアルタイムどう書く 拡大版

ESM じゃんけん大会 - 拡大版 ESM オフラインリアルタイムどう書く (2016/03/24,25)

オフラインリアルタイムどう書く という、 @Nabetani さん主催のイベントを模したものを ESM の社内向けに行ったものです。

出題者: @kunitoo スペシャルサンクス: @mattsan, @mtsmfm

問題

@subfuzion
subfuzion / curl.md
Last active April 19, 2025 09:46
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@azu
azu / js.md
Last active June 23, 2024 17:38
JavaScriptのレベル別書籍のまとめ

前提: 完成していて、比較的支持を集めていて、JavaScriptを中心にした書籍 (DOM APIよりは言語を中心とした内容)

追記: JavaScriptの入門書 #jsprimerを書いている

最初からES2015で学ぶことを前提にした初心者〜中級者向けのJavaScript本がなかったので書いてる。 ES2015でJavaScriptという言語のコア部分は大きく変わったので、それを前提とした内容にする予定。

@joker1007
joker1007 / esm_drinkup_sake_list.md
Last active December 20, 2015 06:48
Rubykaigi2015 ESM drinkupで提供予定の日本酒一覧

ESM Drinkup で提供予定のお酒一覧

  • いづみ橋 恵 青ラベル 純米吟醸 1800ml
  • いづみ橋 桃色黒とんぼ きもと純米酒 1800ml
  • 七本鎗 無有(むう) 無農薬純米 1800ml
  • 七本鎗 純米吟醸 "吟吹雪" 1800ml
  • 七田 純米吟醸 雄町50 1800ml
  • 三井の寿(みいのことぶき) 純米吟醸 酒未来 福岡県産 1800ml
  • 上喜元 純米 "雄町" 1800ml
  • 作 雅乃智(純米大 吟醸中取り) 1.8L
@5t111111
5t111111 / pre-push
Last active November 30, 2015 01:14
An example pre-push hook script to prevent direct pushing to master excluding the following cases -> All commit logs for the commits to be pushed start with "[ALLOW_MASTER]"
#!/bin/bash
# An example hook script to prevent direct pushing to master excluding the following cases
# - All commit logs for the commits to be pushed start with "[ALLOW_MASTER]"
# e.g [ALLOW_MASTER] Fix something
z40=0000000000000000000000000000000000000000
while read local_ref local_sha1 remote_ref remote_sha1
do