Skip to content

Instantly share code, notes, and snippets.

@mkornatz
mkornatz / cf-worker.js
Last active September 4, 2024 20:03
Cloudflare Workers CORS Proxy (supports websockets)
// We support the GET, POST, HEAD, and OPTIONS methods from any origin,
// and allow any header on requests. These headers must be present
// on all responses to all CORS preflight requests. In practice, this means
// all responses to OPTIONS requests.
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS",
"Access-Control-Max-Age": "86400",
}
@trungpv1601
trungpv1601 / README.MD
Created February 4, 2018 02:24
Using Genymotion With Charles Proxy

In your Genymotion Android emulator…

  • Settings -> Wifi -> Press and hold your active network
  • Select “Modify Network”
  • Select “Show Advanced Options”
  • Select “Proxy Settings -> Manual”
  • Set your Proxy to: 10.0.3.2 (Genymotion’s special code for the local workstation)
  • Set your Port to: 8888
  • Press Save

You should now be able to see Genymotion traffic showing up in your Charles Proxy

@binaryseed
binaryseed / subs.md
Last active August 15, 2021 19:56
GraphQl-Subscriptions-Absinthe-SSE

It's possible to do GraphQl Subscriptions over basic HTTP 1.1 with Server Sent Events!!

Start the needed Supervisors...

supervisor(Streamer.Supervisor, [[pubsub: MyPubSub]])

Mount the Plug...

@cloud8421
cloud8421 / ms_test.exs
Created August 10, 2016 14:38
Maps and match specs in elixir
defmodule MsTest do
use ExUnit.Case
doctest Ms
@bob %{name: "Bob", job: "developer"}
@alice %{name: "Alice", job: "musician"}
@john %{name: "John", job: "musician"}
@ada %{name: "Ada", job: "developer"}
@alan %{name: "Alan", job: "developer"}
@table :users
@rob-murray
rob-murray / find_dups.rb
Last active November 8, 2024 09:21
Rails find duplicate records
columns_that_make_record_distinct = [:some_id, :another_name]
duplicate_records = Model.where.not(id: Model.select("MIN(id) as id").group(columns_that_make_record_distinct))
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@staltz
staltz / introrx.md
Last active November 20, 2024 07:53
The introduction to Reactive Programming you've been missing
@dommmel
dommmel / Vagrantfile
Last active August 29, 2015 14:02
Setup Dokku on Vagrant - easy!
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
export HOST_USER=$1
apt-get update -y && apt-get -y install git
# Install Dokku
wget -qO- https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh | DOKKU_TAG=v0.2.3 bash
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active November 19, 2024 18:00
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@dblandin
dblandin / Rakefile
Last active June 17, 2016 15:30 — forked from ParkinT/Rakefile
RubyMotion Configuration and Deploy/Release
# -*- coding: utf-8 -*-
$:.unshift('/Library/RubyMotion/lib')
require 'motion/project/template/ios'
require 'bundler'
Dir.glob('./config/*.rb').each { |file| require file }
if ARGV.join(' ') =~ /spec/
Bundler.require :default, :development, :spec
elsif ARGV.join(' ') =~ /testflight/