Skip to content

Instantly share code, notes, and snippets.

View gudmundur's full-sized avatar

Guðmundur Bjarni Ólafsson gudmundur

View GitHub Profile
@clipperton
clipperton / ike-film-list.md
Last active October 29, 2022 22:25
Ike's favorite films
@arnar
arnar / u2f-api.js
Created February 18, 2015 17:41
High-level U2F API for Chrome 41+
// 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+.
*/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/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
#
@jasoncodes
jasoncodes / gist:1223731
Created September 17, 2011 07:45
Installing Ruby 1.9.3 with rbenv on OS X
# 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
@jokull
jokull / index.html
Created September 7, 2011 11:40
Public Instagram hashtag using Backbone.js and CoffeeScript
<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>
@bohde
bohde / resources.py
Created April 13, 2011 15:52
Dispatch to a different resource if the pk is 'self'
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)
@toastdriven
toastdriven / user1.py
Created April 12, 2011 17:27
First example uses a ``OneToOne`` profile, the second uses the traditional Django profile bits.
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)
@bohde
bohde / api.py
Created December 24, 2010 15:48
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))
======================================================
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