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:
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
====================================================== | |
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10 | |
====================================================== | |
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu | |
8.10. The article is targeted at a production environment, but keep in mind | |
this is a more generalized environment. You may have different requirements, | |
but this article should at least provide the stepping stones. | |
The article will use distribution packages where nesscary. As of 8.10 the |
<html> | |
<head> | |
<script type="text/template" id="tpl-instagram-post"> | |
<a href="<%= link %>"><img src="<%= images.low_resolution.url %>"></a> | |
<p class="date"><%= created_time %></p> | |
<p class="user">@<%= user.username %></p> | |
<% if(caption){ %> | |
<p class="caption"><%= caption.text %></p> | |
<% } %> | |
</script> |
class UserResource(ModelResource): | |
def dispatch_detail(request, **kwargs): | |
if kwargs.get('pk') == "self": | |
# This assumes that self.is_authenticated sets request.user | |
self.is_authenticated(request) | |
kwargs['pk'] = request.user.id | |
return CurrentUserResource.dispatch_detail(request, **kwargs) | |
return super(UserResource, self).dispatch_detail(request, **kwargs) | |
from django.contrib.auth.models import User | |
# from tastypie.authentication import ApiKeyAuthentication | |
from tastypie.authorization import DjangoAuthorization | |
from tastypie import fields | |
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS | |
from core.api.authentication import OpenReadApiKeyAuthentication | |
class UserResource(ModelResource): | |
bio = fields.CharField(attribute='profile__bio', null=True) |
def post_list(self, request, **kwargs): | |
deserialized = self.deserialize(request, | |
request.raw_post_data, | |
format=request.META.get('CONTENT_TYPE', | |
'application/json')) | |
bundle = self.build_bundle(data=dict_strip_unicode_keys(deserialized)) | |
self.is_valid(bundle, request) | |
updated_bundle = self.obj_create(bundle, request=request) | |
resp = self.create_response(request, | |
self.full_dehydrate(updated_bundle.obj)) |
// Copyright 2014 Google Inc. All rights reserved | |
// | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file or at | |
// https://developers.google.com/open-source/licenses/bsd | |
/** | |
* @fileoverview High-level U2F API for Chrome 41+. | |
*/ |