Skip to content

Instantly share code, notes, and snippets.

View jottenlips's full-sized avatar
:octocat:

John Ottenlips Franke jottenlips

:octocat:
View GitHub Profile
@zbyte64
zbyte64 / events.py
Created November 1, 2020 18:33
Example: Django-Graphene subscriptions with graphene_subscriptions and django_lifecycle
from enum import Enum, auto
class NotificationEvents(Enum):
NEW_MESSAGE = auto()
UPDATE_MESSAGE = auto()
@shritesh
shritesh / reason_p5_stopwatch.re
Last active March 19, 2020 16:13
ReasonML p5.js Stopwatch
type p5;
type sketch;
type button;
type state =
| Initializing
| NotStarted(button)
| Running(button, int)
@salwator
salwator / ariadne_federated.py
Last active November 19, 2019 13:01
Ariadne service implementation that extends saleor with fake reviews
from dataclasses import dataclass
from typing import List
from ariadne import ObjectType, MutationType, QueryType, snake_case_fallback_resolvers
from ariadne_extensions import federation
from ariadne.asgi import GraphQL
query = QueryType()
manager = federation.FederatedManager(query=query, schema_sdl_file="schema.graphql")
@mrkpatchaa
mrkpatchaa / README.md
Last active June 6, 2024 21:03
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@andrassomogyi
andrassomogyi / AViewController.h
Created September 25, 2015 09:43
SFSafariViewController Objective-C example
#import <UIKit/UIKit.h>
@import SafariServices;
@interface AViewController : UIViewController
//
// ...
//
@end
@therealklanni
therealklanni / ES6.sublime-build
Last active July 10, 2019 18:09
ES6 REPL in Sublime Text
{
"cmd": ["/usr/local/bin/babel-node $file"],
"shell": true,
"selector": "*.js"
}
@berzniz
berzniz / NSObject+Debounce.h
Created January 25, 2014 16:18
Debounce method for Objective C
@interface NSObject (Debounce)
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay;
@end
from django import http
from django.conf import settings
"""
Put this file in a directory called, eg, 'middleware,' inside your django
project. Make sure to create an __init__.py file in the directory so it can
be included as a module.
Set the values for
XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS
@adamgit
adamgit / gist:3705459
Last active December 11, 2023 16:27
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
@jessykate
jessykate / django-crossdomainxhr-middleware.py
Created June 16, 2012 12:44 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
'''
EXAMPLE USAGE:
Put this file in a directory called, eg, 'middleware,' inside your django