Note: dm is an alias for docker-machine
dm ls
dm create -d virtualbox hello-world
dm env hello-world
import UIKit | |
public enum DisplayType { | |
case unknown | |
case iphone4 | |
case iphone5 | |
case iphone6 | |
case iphone6plus | |
static let iphone7 = iphone6 | |
static let iphone7plus = iphone6plus |
// Here we demonstrate functions in swift | |
// Concentrating on three points: | |
// * Pass-by-Value | |
// * Pass-by-Reference | |
// * External Name / Internal Name | |
// | |
// Drop this in a playground to see instant results. | |
func combineStr(str1: String, str2: String) -> String { |
/******This Gist explains how to create instagram like Gradient color transition in android.******/ | |
1. Create some gradient color drawables inside drawable Folder. | |
a) color1.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<gradient | |
android:startColor="#c44e4e" | |
android:endColor="#dcb9b9" | |
android:angle="0"/> |
/* | |
To run this: | |
open command prompt execute 'swipl' | |
then run ['path/to/this/file.pl']. | |
then query away. | |
*/ | |
% FACTS | |
likes(jana, omar). | |
likes(omar, jana). |
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
passwd
apt-get update
apt-get upgrade
apt-get install fail2ban
useradd deploy
mkdir /home/deploy
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
from django.http import StreamingHttpResponse | |
from wsgiref.util import FileWrapper | |
import mimetypes | |
import os | |
import re | |
range_re = re.compile(r'bytes\s*=\s*(\d+)\s*-\s*(\d*)', re.I) | |
class RangeFileWrapper (object): | |
def __init__(self, filelike, blksize=8192, offset=0, length=None): |