Skip to content

Instantly share code, notes, and snippets.

@kirsteins
kirsteins / Array -> UnsafeMutablePointer -> Array
Last active October 11, 2022 12:25
Array -> UnsafeMutablePointer -> Array
var initalArray = [1, 2, 3]
let pointer: UnsafeMutablePointer<Int> = UnsafeMutablePointer(initalArray)
let arrary = Array(UnsafeBufferPointer(start: pointer, count: initalArray.count))

Node.js + Express + socket.io で、入力に応じて画像を返す

  • Node.js v0.11.11
  • Express v3.5.2
  • socket.io v0.9.16
事前準備
  • 画像を数枚準備 (今回は neko.jpg, inu.jpg, umi.jpeg, hana.jpg, fukuoka.jpg)
@shinyaohira
shinyaohira / App States and Multitasking.md
Last active October 5, 2023 07:57
アプリケーションの状態とマルチタスキング

全体的に簡略化し、必要と思われる部分を抜粋しました。

  • Not running

    アプリは起動されていないか、実行されていたけれどもシステムによって終了されています。

  • Inactive

@pwalsh
pwalsh / pyo on Mac OS X
Last active April 24, 2016 05:23
A short gist explaining how to compile pyo - the powerful Audio/DSP library for Python, on Mac OS X. The instructions are specifically for installing pyo with a brewed Python install - not with Mac OS X system Python.
# using brew installed Python
brew install portaudio portmidi libsndfile liblo jack
brew link portaudio portmidi libsndfile liblo
cd ~/Sites/tmp
svn checkout http://pyo.googlecode.com/svn/trunk/ pyo-read-only
@skeeet
skeeet / xcode_ramdisk.sh
Created April 12, 2012 13:35 — forked from MaximKeegan/xcode_ramdisk.sh
Create a RAM disk for using with XCode
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@nichtich
nichtich / wiktionarylookup.html
Created November 12, 2010 19:10
Look up a word in Wiktionary via MediaWiki API and show the Wiktionary page
<html>
<head>
<script type="text/javascript" src="./jquery-1.4.3.min.js"></script>
<script type="text/javascript">
var baseURL = 'http://en.wiktionary.org';
function showPage(page,text) {
var sourceurl = baseURL + '/wiki/' + page;
$('#pagetitle').text(page);
$('#wikiInfo').html(text);
$('#sourceurl').attr('href',sourceurl);