Skip to content

Instantly share code, notes, and snippets.

@g00fy-
g00fy- / RESTMiddleware.py
Created August 22, 2011 00:54
Simple Django Middleware for handling Form & Multipart Form PUT & DELETE methods AKA REST (GET,POST,PUT,DELETE)
from django.http import QueryDict
from django.http.multipartparser import MultiValueDict
class RESTMiddleware(object):
def process_request(self,request):
request.PUT=QueryDict('')
request.DELETE = QueryDict('')
method = request.META.get('REQUEST_METHOD','').upper() #upper ? rly?
if method == 'PUT':
self.handle_PUT(request)
@richy486
richy486 / youtube_m3u8.txt
Created January 6, 2017 21:16
get youtube streaming url
from: http://stackoverflow.com/a/35631022/667834
$ brew install youtube-dl
$ youtube-dl --list-formats https://www.youtube.com/watch\?v\=[YouTube video id]
shows something like:
....
91 mp4 144p HLS , h264, aac @ 48k
@novemberfiveco-gists
novemberfiveco-gists / WKCookieWebView.swift
Last active June 26, 2023 10:02
A WKWebView subclass that passes cookies after a 302 redirect response.
//
// WKCookieWebView.swift
//
// Created by Jens Reynders on 30/03/2018.
// Copyright (c) 2018 November Five
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@avinashselvam
avinashselvam / filter.swift
Created June 19, 2019 11:15
A swift class that implements GPU based image processing
//
// filter.swift
// fltr
//
// Created by Avinash on 18/06/19.
// Copyright © 2019 eightyfive. All rights reserved.
//
import Metal
import MetalKit
reference url
"""
https://pypi.org/project/django-crontab/
"""
install cron tab for django
"""
pip install django-crontab
"""
@tranductam2802
tranductam2802 / main.dart
Last active August 5, 2021 18:22
A TabBar supported for bubble view style and wheel scroll
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() async =>
runApp(MaterialApp(debugShowCheckedModeBanner: false, home: DemoScreen()));
class DemoScreen extends StatefulWidget {
@override
_DemoScreenState createState() => _DemoScreenState();
}
@nrubin29
nrubin29 / homebrew_m1.sh
Last active November 24, 2023 11:27
Install Native Homebrew on Apple Silicon M1
# We'll be installing Homebrew in the /opt directory.
cd /opt
# Create a directory for Homebrew. This requires root permissions.
sudo mkdir homebrew
# Make us the owner of the directory so that we no longer require root permissions.
sudo chown -R $(whoami) /opt/homebrew
# Download and unzip Homebrew. This command can be found at https://docs.brew.sh/Installation.