This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DragndropOrderedModelAdmin(OrderedModelAdmin): | |
def move_above_view(self, request, object_id, other_object_id): | |
obj = get_object_or_404(self.model, pk=unquote(object_id)) | |
other_obj = get_object_or_404(self.model, pk=unquote(other_object_id)) | |
obj.above(other_obj) | |
# go back 3 levels (to get from /pk/move-above/other-pk back to the changelist) | |
return HttpResponseRedirect('../../../') | |
def get_urls(self): | |
def wrap(view): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mike Bianco <[email protected]> | |
# Description: Example of using Stripe's subscription billing to add usage based billing | |
# information to the customer's recurring invoice | |
require 'stripe' | |
require 'sinatra' | |
Stripe.api_key = ENV['STRIPE_KEY'] | |
# This example uses sinatra to listen for webhooks. You can easily use rails, or any other framework/language. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:alpine | |
RUN apk update && apk upgrade && \ | |
apk add --no-cache git zip | |
ARG TERRAFORM_VERSION | |
RUN git clone --single-branch --branch v${TERRAFORM_VERSION} https://github.com/hashicorp/terraform.git /go/src/github.com/hashicorp/terraform | |
RUN cd $GOPATH/src/github.com/hashicorp/terraform && echo $GOPATH && go install ./tools/terraform-bundle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from __future__ import print_function | |
try: | |
from ruamel import yaml | |
except ImportError: | |
import yaml | |
# Map a Docker Compose "service" name to its image. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.4-alpine | |
RUN gem install ultrahook | |
ENTRYPOINT ["ultrahook"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Catch php output buffering data over jQuery AJAX | |
* | |
* @author: Sohel Rana ([email protected]) | |
* @author url: https://blog.sohelrana.me | |
* @link: https://blog.sohelrana.me/catch-php-output-buffering-data-jquery-ajax/ | |
* @licence MIT | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1-apache | |
ADD . /var/www | |
ADD ./site.conf /etc/apache2/sites-enabled/000-default.conf | |
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && \ | |
docker-php-ext-install mcrypt pdo_mysql opcache && \ | |
pecl install redis-3.1.2 && docker-php-ext-enable redis && \ | |
a2enmod rewrite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (..) | |
import Html exposing (Html, div, p, text) | |
-- Data type for the flags | |
type alias Flags = | |
{ user : String | |
, token : String | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Modal Form Example | |
type: module | |
description: 'Modal Form Example module' | |
package: Example | |
version: VERSION | |
core: 8.x |