Skip to content

Instantly share code, notes, and snippets.

@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@GOROman
GOROman / SuperHacker.rb
Last active January 1, 2016 22:59
スーパーハカー用プログラム
# スーパーハカー用プログラム
require 'socket'
# 開くポート
PORT = 5656 # 適当なポート
# TCPサーバーになっちゃう
TCPServer.open( PORT ) do |server|
loop do
@GOROman
GOROman / UniTwi.cs
Last active March 3, 2018 16:29
Unityから画像付きツイート(update_with_media)をする。WWWクラスでは multipart/form-data が使えないのでTCPを直接叩く
// 断片
TcpClient tc = new TcpClient();
tc.Connect("api.twitter.com", 80);
using (NetworkStream ns = tc.GetStream())
{
System.IO.StreamWriter sw = new System.IO.StreamWriter(ns);
System.IO.StreamReader sr = new System.IO.StreamReader(ns);
@GOROman
GOROman / Zaoriku.cs
Last active August 29, 2015 14:04
おお ゆにてい よ、しんでしまうとはなにごとだ!
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
// Unity にザオリク機能を追加します
[InitializeOnLoad]
static class Zaoriku
{
static Zaoriku() {
EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
@syun77
syun77 / Token.cs
Created February 5, 2015 00:11
Unityのゲームオブジェクトを使いやすくするクラス
using UnityEngine;
using System.Collections;
/// キャラクター基底クラス.
/// SpriteRendererが必要.
[RequireComponent (typeof(SpriteRenderer))]
public class Token : MonoBehaviour
{
/// プレハブ取得.
/// プレハブは必ず"Resources/Prefabs/"に配置すること.
@ayakix
ayakix / IsMisDo100Yen
Last active August 29, 2015 14:16
ミスドが100円セール中かどうかをチェックするAPI
function doGet(e) {
var json = {"isSale": false};
var response;
try {
response = UrlFetchApp.fetch("http://www.misterdonut.jp/sale/index.html");
} catch(err) {
return createOutput(json);
}
var regexp = /(\d+)年(\d+)月(\d+)日.*(\d+)月(\d+)日/;
@smison
smison / schedule.md
Last active September 30, 2017 10:21
締切があった方が集中できるのでつけているスケジュールメモ

10月

  • コミティア122用中編1本

9月

  • 3~4pの短編2本
  • 10~25ページの短編1本
  • 末日に翌月のスケジュールを調整

8月

  • 3~4p程度の短編2本
@voluntas
voluntas / death_march.md
Last active July 1, 2024 01:31
デスマーチが起きる理由 - 3つの指標

デスマーチが起きる理由 - 3つの指標

著者: 青い鴉(ぶるくろ)さん @bluecrow2

これは結城浩さんの運用されていた YukiWiki に当時 Coffee 様 (青い鴉(ぶるくろ)さん)がかかれていた文章です。 ただ 2018 年 3 月 7 日に YukiWiki が運用停止したため消えてしまいました。その記事のバックアップです。

今は 404 ですが、もともとの記事の URL は http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 になります。

昔、自分がとても感銘を受けた文章なので、このまま読めなくなるのはとてももったいないと思い、バックアップとして公開しています。

@voluntas
voluntas / open_momo.rst
Last active March 1, 2024 13:51
OpenMomo プロジェクト
import sys
def generate_footprint(size, isPCB, hasLED, isReversible):
unit = f"{size:.2f}"
mount = "PCB" if isPCB else "Plate"
# header
body = f'(module SW_Cherry_MX1A_{unit}u_{mount}{"_LED" if hasLED else ""}{"_Reversible" if isReversible else ""} (layer F.Cu) (tedit 5BB19F47)\n'
body += f' (descr "Cherry MX keyswitch, MX1A, {unit}u, {mount} mount, http://cherryamericas.com/wp-body/uploads/2014/12/mx_cat.pdf")\n'
body += f' (tags "cherry mx keyswitch MX1A {unit}u {mount}{" Reversible" if isReversible else ""}")\n'