Skip to content

Instantly share code, notes, and snippets.

View abirafdirp's full-sized avatar

Abirafdi Raditya Putra abirafdirp

View GitHub Profile
@ranelpadon
ranelpadon / django-dependent-field.js
Last active August 28, 2017 04:26
Update the select list field B based on the currently selected option in select list field A. For example, when you select a particular Music Genre, only the related Artists should show. Other common use cases/relationships: Country/Cities, Organization/Members, Company/Contact Persons, Brand/Products, etc.
// Workflow (Genre is the Parent Field, Artist is the Dependent Field):
// 1. user interacts w/ Genre select list widget via JS script.
// 2. JS script fetches the new Artist list in views.py
// 3. JSON response will be used as the new values/options for the Artist select list widget.
(function($) {
$(function() {
// Artist's select option values will depend on
// the Genre's selected option.
var $genreSelectWidget = $('#id_genre');
@marszall87
marszall87 / docker-compose-install.sh
Created September 25, 2015 13:14
Simple script for installing latest Docker Compose on CoreOS >= 717.0.0
#!/bin/bash
mkdir -p /opt/bin
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
@marteinn
marteinn / settings.py
Last active December 27, 2019 17:35
How to use https with S3 + django-storages + boto, with a bucket that contains a dot. (Add this in your settings.py)
AWS_ACCESS_KEY_ID = "YOUR_KEY_ID"
AWS_SECRET_ACCESS_KEY = "YOUR_ACCESS_KEY"
AWS_STORAGE_BUCKET_NAME = "BUCKET-NAME"
AWS_QUERYSTRING_AUTH = False
AWS_S3_SECURE_URLS = True
from boto.s3.connection import OrdinaryCallingFormat, S3Connection
AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
S3Connection.DefaultHost = "s3-eu-west-1.amazonaws.com" # Must match your specific region
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
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!






\