Skip to content

Instantly share code, notes, and snippets.

View benqian's full-sized avatar

Yueping Qian benqian

  • Better
  • Los Angeles CA
View GitHub Profile
@benqian
benqian / pipelines.py
Created March 17, 2024 05:59 — forked from abevoelker/pipelines.py
scrapy RabbitMQ pipeline
# project_name/pipelines.py
from scrapy import signals
from scrapy.utils.serialize import ScrapyJSONEncoder
from scrapy.xlib.pydispatch import dispatcher
from carrot.connection import BrokerConnection
from carrot.messaging import Publisher
from twisted.internet.threads import deferToThread
---
Resources:
Api:
Type: 'AWS::ApiGatewayV2::Api'
Properties:
Name: !Ref 'AWS::StackName'
ProtocolType: WEBSOCKET
RouteSelectionExpression: '\$default'
DefaultRoute:
Type: 'AWS::ApiGatewayV2::Route'
@benqian
benqian / README.md
Created December 7, 2019 22:51 — forked from neilellis/README.md
An example Blue/Green deployment using Tutum and Cloudflare (for DNS)

Expects one argument the name of the production stack file for Tutum.

(see https://support.tutum.co/support/solutions/articles/5000569899-stacks )

Requires these environment variables to be set

  • CLOUDFLARE_DOMAIN - root domain of your app, e.g. example.com
  • CLOUDFLARE_KEY - your Cloudflare API key
  • CLOUDFLARE_EMAIL - your Cloudflare email address e.g. fred@example.com
  • PROJECT_NAME - a short name for your project e.g. example
@benqian
benqian / minikube_ubuntu_installation.md
Created December 1, 2019 07:33 — forked from gonzaloplaza/minikube_ubuntu_installation.md
Minikube installation on Ubuntu 16.04 LTS

Minikube Installation on Ubuntu 16.04 LTS

Overview:

  1. Install hypervisor (Virtualbox)
  2. Get and install Kubectl (repositories)
  3. Get and install Minikube last version
  4. Start and Test Minikube local cluster and expose demo service

Install VirtualBox hypervisor

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Logging Client-Side Errors With AngularJS And Stacktrace.js
</title>
<style type="text/css">

Zero downtime deploys with unicorn + nginx + runit + rvm + chef

Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).

Other application notes:

  • Our application uses MongoDB, so we don't have database migrations to worry about as with MySQL or postgresql. That does not mean that we won't have to worry about issues with the database with indexes being built in MongoDB or what have you.
  • We use capistrano for deployment.

Salient points for each file: