Skip to content

Instantly share code, notes, and snippets.

View mironal's full-sized avatar
🍷

mironal mironal

🍷
View GitHub Profile
@mironal
mironal / code-quantity.sh
Created October 24, 2013 09:02
出っ出ーーwwwww 全然コーディングしてない人を晒し上げ奴wwwwwwwwwwwwwwwww
#!/bin/bash
#
# The MIT License (MIT)
# Copyright (c) 2013 mironal
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
@sh4869
sh4869 / Arduinode_Error.txt
Last active August 29, 2015 13:55
Arduinodeを使用しchromeでローカルホストに接続する時に起こるエラーレポート
--一回目
JSON parse error : SyntaxError: Unexpected end of input
/home/sh4869/heimcontrol.js/node_modules/arduinode/arduinode.js:134
throw e;
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at SerialPort.<anonymous> (/home/sh4869/heimcontrol.js/node_modules/arduinode/arduinode.js:118:27)
@ShamylZakariya
ShamylZakariya / debounce.swift
Created September 4, 2014 21:01
Simple Swift Debouncer
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() {
var lastFireTime:dispatch_time_t = 0
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC))
return {
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0)
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
@ajiyoshi-vg
ajiyoshi-vg / gist:d72b2cae129d73a405e4
Last active August 29, 2015 14:10
if式 / if文 の条件節で、左辺に定数を書くべき言語はあるか? @ajiyoshi.gist

if式 / if文 の条件節で、左辺に定数を書くべき言語はあるか? @ajiyoshi.gist

twitterからながれてきたこの話題。昔のCコンパイラは、if文の条件節で代入を書いても文句を言わなかったので、このようなコードに何の警告も出なかった。

#include<stdio.h>

int main() {
  int x = 0;
  /* おそらく意図と違うx == 1 と書くべきであった
@zats
zats / Node.h
Last active March 18, 2021 17:48
Implementing NSCopying, NSMutableCopying for immutable class with mutable counterpart
#import <Foundation/Foundation.h>
@interface Node : NSObject <NSCopying, NSMutableCopying>
@property (nonatomic, weak, readonly) Node *parent;
@property (nonatomic, strong, readonly) Node *left;
@property (nonatomic, strong, readonly) Node *right;
- (instancetype)initWithParent:(Node *)parent left:(Node *)left right:(Node *)right;
@end
@interface MutableNode : Node
@koyhoge
koyhoge / gist:afe31518f63c16120f2d
Last active June 1, 2023 06:32
エンジニアのための法律勉強会#1『受託開発における契約時の注意事項』参加メモ

エンジニアのための法律勉強会#1『受託開発における契約時の注意事項』参加メモ

前提

  • システム開発そのものは素人だけど、裁判にはクライアント/開発側の両方で関わったことがある。
  • 裁判官はもっとシステム開発については分かってない。
@codelynx
codelynx / simd+ext.swift
Last active November 17, 2021 18:56
swift: float4x4 extension to scale, rotate, translate 4x4 matrix
//
// simd+ext.swift
//
// Created by Kaz Yoshikawa on 11/6/15.
//
//
import Foundation
import simd
import GLKit
@yuheiy
yuheiy / spacing-rules.md
Last active October 28, 2021 15:47
ウェブデザインの余白に規則性を持たせるためのパターン

ウェブデザインの余白に規則性を持たせるためのパターン

フォントサイズベース

$spacing: 1rem;

body {
  margin: ($spacing * 4) $spacing;
}
@sugumura
sugumura / gen_icons.sh
Created May 16, 2017 05:42
Mac OS X用のアイコンファイル(.icns)を生成するスクリプトです。[email protected](解像度が1024x1024)のファイルを実行フォルダに設置して実行してください。
#!/bin/sh
# for Mac OS X
# required sips command
cd `dirname $0`
outdir="icon.iconset"
mkdir -p $outdir
if [ -e "[email protected]" ]; then