This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
NSArray *allowedImageFileExtensions = [NSArray arrayWithObjects:@"png",@"jpg",@"jpeg",@"gif",@"bmp",nil]; | |
// ... | |
- (IBAction)displayImagePickerSheet:(id)sender { | |
NSOpenPanel *panel = [NSOpenPanel openPanel]; | |
[panel setAllowedFileTypes:allowedImageFileExtensions]; | |
[panel setDirectory:NSHomeDirectory()]; | |
[panel setAllowsMultipleSelection:NO]; | |
[panel setCanChooseDirectories:NO]; |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
<?php | |
$data = (object)array( | |
"html" => "<foo bar=\"baz\"/> &", | |
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī", | |
"hebrew" => "עִבְרִית, Ivrit", | |
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén", | |
"korean" => "한국어/조선말", | |
"japanese" => "日本語 Nihongo", | |
"umlauts" => "äüöãáàß", |
/* | |
* To compile objective-c on the command line: | |
* | |
* gcc -framework Foundation objc-gcc.m | |
* | |
* You may have to link with -lobjc or other libs, | |
* as required. | |
*/ | |
#import <Foundation/Foundation.h> |
CC := gcc | |
CFLAGS := -g -Wall | |
LIBS := -lallegro | |
SOURCES := $(shell find src/ -type f -name "*.c") | |
OBJECTS := $(SOURCES:.c=.o) | |
TARGET := game | |
all: $(SOURCES) $(TARGET) | |
$(TARGET): $(OBJECTS) |
<!-- using the truncate filter --> | |
{% for post in site.posts limit:10 %} | |
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2> | |
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span> | |
{% if post.content.size > 2000 %} | |
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node --> | |
<a href="{{ post.url }}">read more</a> | |
{% else %} | |
{{ post.content }} | |
{% endif %} |
import numpy as np | |
def km_segmentation(image, n_segments=100, ratio=50, max_iter=100): | |
# initialize on grid: | |
height, width = image.shape[:2] | |
# approximate grid size for desired n_segments | |
step = np.sqrt(height * width / n_segments) | |
grid_y, grid_x = np.mgrid[:height, :width] | |
means_y = grid_y[::step, ::step] |
using UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class CleanUpWindow : EditorWindow | |
{ | |
bool groupEnabled = true; | |
List<string> usedAssets = new List<string>(); |
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |