Skip to content

Instantly share code, notes, and snippets.

@mortenege
mortenege / django_channels_aws_eb_alb.md
Created March 4, 2018 06:48
Django Channels on AWS Elastic Beanstalk using an ALB

Django Channels on AWS Elastic Beanstalk using an ALB

This post will describe how to set up a Django Channels solution using AWS Elastic Beanstalk [EB]. This guide is written in response to there being very little information on the combination of Channels and AWS. Mainly many solutions end with problems regarding websockets, which is a fundamental part of Channels. See here and here. This guide will consist of multiple step-by-step parts including

  • How to set up a local Django Channels solution
  • How to set up an Application Load Balancer [ALB] to serve websockets
  • How to configure EB to deploy Cha
anonymous
anonymous / FuziSerializer.swift
Created November 18, 2015 17:29
Fuzi Alamofire Response serializer
extension Request {
public static func XMLResponseSerializer() -> ResponseSerializer<XMLDocument, NSError> {
return ResponseSerializer { request, response, data, error in
guard error == nil else { return .Failure(error!) }
guard let validData = data else {
let failureReason = "Data could not be serialized. Input data was nil."
let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason)
return .Failure(error)
}
@benrudhart
benrudhart / gist:1525c82fea925c985b90
Last active August 29, 2015 14:09 — forked from shiningabdul/gist:8634264
Script for Uploading an xcode archive to HockeyApp with Xcode Server 4.0 using Xcode 6.1. Automatically creates a markdown change log based on the commit bodies from accepted pull requests.
# Valid and working as of 11/10/2014
# Xcode 6.1, XCode Server 4.0
#Upload Archive to HockeyApp
#Settings
PRODUCT_NAME="<Product name>"
PRODUCT_FOLDER="<Product Folder>"
SIGNING_IDENTITY="<identity>"
#"This has to be exactly what you see in Keychain -> My Certificates"
@jedi4ever
jedi4ever / upload-to-appstore.sh
Created August 18, 2014 12:13
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@JedWatson
JedWatson / KeystoneApiExample.md
Last active July 26, 2021 11:29
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@bimawa
bimawa / FadeMask
Created July 25, 2013 09:12
How to set gradient transparent mask for UIVIew.layer. its needs for create scroll fade animation effect.
- (void)viewDidLoad
{
[super viewDidLoad];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Screen Shot 2013-07-23 at 5.29.05 PM.png"]];
UIView *viewWithMask = [[UIView alloc] initWithFrame:CGRectMake(0, 200, self.view.frame.size.width, 100)];
[viewWithMask setBackgroundColor:[UIColor greenColor]];
// Recreate gradient mask with new fade length
CAGradientLayer *gradientMask = [CAGradientLayer layer];
gradientMask.bounds = viewWithMask.layer.bounds;
gradientMask.position = CGPointMake(CGRectGetMidX(viewWithMask.bounds), CGRectGetMidY(viewWithMask.bounds));