sudo apt-get update
sudo apt-get install -y xfce-session tightvncserver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# on ubuntu: need some utils & dev libs | |
sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev | |
# compile nginx | |
cd /tmp | |
curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz | |
cd nginx* | |
./configure --with-http_ssl_module --with-http_dav_module \ |
This is a single-purpose fork of vanto's simple liquid tag that helps to easily embed images, videos or slides from OEmbed enabled providers, which in turn uses Magnus Holm's great oembed gem which connects to the OEmbed endpoint of the link's provider and retrieves the HTML code to embed the content properly (i.e. an Image tag for Flickr) This fork allows only Flickr embeds, from one particular album (since that's the way I work my blog) but allows a much simpler tag, not requiring you to type out the whole URL every time.
- Make sure you have the
ruby-oembed
gem (Rubygems, Github) installed. - Copy
flickrimg.rb
to<your-jekyll-project>/_plugins
- Add a "flickrimg" config entry to your
_config.yml
, with an 'album' subentry which contains the bit of the flickr URL that identifies your album. In other words, if you have a Flickr URL such as `
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os.path, hashlib, re | |
import zipfile | |
import subprocess | |
from StringIO import StringIO | |
from io import BytesIO | |
# | |
# Passbook Hack | |
# David Schuetz | |
# 30 May 2014 |
Implementation of redux inside any react.js or react-native application,
- we will create an instance of the redux store.
- We are going to create a provider tag from react redux library
- Then render that provider tag passing in the store as a prop, then any child component to this provider tag will have access to this store through the context system inside of react.
import { Provider } from ‘react-redux’;
// In main.js- to create a store create one in a separate folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extension of http://www.yilmazhuseyin.com/blog/dev/create-thumbnails-imagefield-django/ | |
# Note: image_folder and thumbnail_folder are both a callable (ie. a lambda that does a '/'.join()) | |
class Image(Media): | |
image = models.ImageField( | |
upload_to=image_folder | |
) | |
thumbnail = models.ImageField( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Provides a `DateTimeRange` class, which is used for managing ranges of datetimes. | |
Forked from https://gist.github.com/obeattie/213328. | |
""" | |
import datetime | |
class DateTimeRange(object): | |
"""Represents a range of datetimes, with a start and (optionally) an end. | |
Basically implements most of the methods on a standard sequence data type to provide | |
some lovely syntactic sugar. Specifically, you can iterate on this, index it, slice it, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apparently a very small example | |
# https://blog.realkinetic.com/building-minimal-docker-containers-for-python-applications-37d0272c52f3 | |
FROM python:3 | |
# Get current version of django | |
RUN git clone http://github.com/django/django | |
WORKDIR django | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ |