Skip to content

Instantly share code, notes, and snippets.

View jameswyse's full-sized avatar
🏠
Codin'

James Wyse jameswyse

🏠
Codin'
View GitHub Profile
@fritolays
fritolays / mover_tuning_exclusions.sh
Last active March 11, 2024 15:35
This script enables the Mover Tuning plugin for Unraid to be able to exclude files and/or folders.
#!/bin/bash
# (https://forums.unraid.net/topic/70783-plugin-mover-tuning/)
# This script enables the Mover Tuning plugin for Unraid to be able to exclude files and/or folders.
# Script activity can be viewed in Unraid's system log (Tools -> System Log).
# First, it reads lists of directories and files from provided text files.
# Then, it converts any Windows line endings to Unix line endings in these lists.
# Next, it checks if the paths listed in the files are valid directories or files.
# Finally, valid file and directory paths are compiled into a single output file for use by the Mover Tuning plugin.
@helfer
helfer / apollo-1-migration.md
Last active May 31, 2017 01:09
Migrating from Apollo Client 0.x to 1.0

Migrating from Apollo Client 0.x to 1.0

Here are the main breaking changes between the 0.x and 1.0 versions of Apollo Client.

fetchMore

The structure of fetchMoreResult has been changed. Previously fetchMoreResult used to contain data and loading fields, now fetchMoreResult is what fetchMoreResult.data used to be. This means your updateQueries function has to change as follows:

updateQuery: (prev, { fetchMoreResult }) => {
@bforchhammer
bforchhammer / lazy_batching.py
Last active February 18, 2017 08:56
Graphene lazy batched requests
from graphql.execution.executors.sync import SyncExecutor
"""
Usage example:
from functools import partial
class MyServiceCache(BulkRequestCache):
def __init__():
self.requested_values = set()
@zbyte64
zbyte64 / async_app.py
Created May 26, 2016 20:47
Asyncio Views With Django
import asyncio
from django import http
from django.core.urlresolvers import set_script_prefix
from django.utils.encoding import force_str
from django.core.handlers.wsgi import get_script_name
from django_wsgi.handler import DjangoApplication
import logging
import logging
import sys
@idibidiart
idibidiart / GraphQL-Architecture.md
Last active September 16, 2023 18:36
Building an Agile, Maintainable Architecture with GraphQL

Building a Maintainable, Agile Architecture for Realtime, Transactional Apps

A maintainable application architecture requires that the UI only contain the rendering logic and execute queries and mutations against the underlying data model on the server. A maintainable architecture must not contain any logic for composing "app state" on the client as that would necessarily embed business logic in the client. App state should be persisted to the database and the client projection of it should be composed in the mid tier, and refreshed as mutations occur on the server (and after network interruption) for a highly interactive, realtime UX.

With GraphQL we are able to define an easy-to-change application-level data schema on the server that captures the types and relationships in our data, and wiring it to data sources via resolvers that leverage our db's own query language (or data-oriented, uniform service APIs) to resolve client-specified "queries" and "mutations" against the schema.

We use GraphQL to dyn

// Minimal middleware implementation
// Works in node and the browser
// Inspired by https://github.com/h2non/midware
// Usage examples are at the bottom...
function middleware(ctx) {
let calls = [];
let errorHandlers = [];
var ctx = ctx || null;
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@hiltmon
hiltmon / merge_asana_into_omnifocus.rb
Last active October 2, 2018 17:58
Updated Merge Asana into OmniFocus script
#!/usr/bin/env ruby -E utf-8
# merge_asana_into_omnifocus.rb
# Hilton Lipschitz
# http://www.hiltmon.com
# Use and modify freely, attribution appreciated
# Script to import Asana projects and their tasks into
# OmniFocus and keep them up to date from Asana.
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links
@airportyh
airportyh / jsconf_slides_codes_and_notes.md
Last active June 19, 2017 20:51
JSConf 2014 Slides, Codes and Notes.

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)