Skip to content

Instantly share code, notes, and snippets.

@mxcl
mxcl / install_homebrew.markdown
Created March 6, 2010 15:14
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
@rodbegbie
rodbegbie / facebook.py
Created September 3, 2011 00:15
Hacked version of "official" (but now unsupported) Facebook Python SDK to support OAuth 2.0
#!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@teramako
teramako / nyancat.js
Created December 8, 2011 12:16
nyancatをコンソール出力
/*
* Nyancat (SpiderMonkey version)
* https://gist.github.com/1446827
*
* @see https://github.com/klange/nyancat
*/
function start() {
function frameIterator() {
while (true) {
@mkottman
mkottman / twoline_prompt.sh
Last active July 19, 2023 06:53
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
@willurd
willurd / web-servers.md
Last active May 7, 2024 04:58
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jendiamond
jendiamond / gist:6128723
Last active April 11, 2024 11:35
Creating your own Gem & Command Line Interface Using Bundler

Presentation slides

Create a Gem - Make it a CLI - Add Rspec Tests

Create a Gem - Make it a Command Line Interface - Add Rspec Tests Using Bundler & Thor

#Creating your own Gem

  1. Run this command in your Terminal. This creates and names all the files you need for your gem. We are going to create a Lorem Ipsum Generator; you can call it whatever you want but seeing as we are creating a Lorem Ipsum generator we'll call it lorem. Read about gem naming conventions.
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@phrawzty
phrawzty / 2serv.py
Last active May 2, 2024 12:27
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@keijiro
keijiro / 00_README.md
Last active April 6, 2022 07:26
About Xcode Manipulation API in Unity

Unity から出力される Xcode プロジェクトをカスタマイズする方法 - Xcode Manipulation API

Unity 5 には Xcode Manipulation API が標準で搭載されており、これを使うことで、Unity の出力する Xcode プロジェクトを比較的簡単にカスタマイズすることができます。

ここでは例として、Unity から出力される Xcode プロジェクトの Info.plist ファイルを書き換えてみます。

下にある XcodeProjectUpdater.cs がそれです。このファイルを Editor ディレクトリ下に放り込んでおきます。すると、ビルド時に Info.plist を書き換えて、“TestEntry” というキーに “Hello” という値を設定します。見たそのまんまのシンプルな内容です。

鍵となるのは UnityEditor.iOS.Xcode に用意されている PlistDocument と PBXProject です。これらのクラスを使うことで、plist ファイルや Xcode プロジェクトファイルの書き換えが簡単に行えるわけです。

@mono0926
mono0926 / commit_message_example.md
Last active March 29, 2024 03:40
[転載] gitにおけるコミットログ/メッセージ例文集100