Skip to content

Instantly share code, notes, and snippets.

@uknj
uknj / GICS Mappings - March 2023 Update.csv
Last active December 16, 2025 21:58
Mapping of all GICS codes from Sub-Industry through to sector. Using the latest GICS update effective March 17 2023. All commentary removed.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
Sub-Industry Code,Sub-Industry,Definition,Industry Code,Industry,Industry Group Code,Industry Group,Sector Code,Sector
10101010,Oil & Gas Drilling,Drilling contractors or owners of drilling rigs that contract their services for drilling wells.,101010,Energy Equipment & Services,1010,Energy,10,Energy
10101020,Oil & Gas Equipment & Services,"Manufacturers of equipment, including drilling rigs and equipment, and providers of supplies such as fractured silica and services to companies involved in the drilling, evaluation and completion of oil and gas wells.
This Sub-Industry includes companies that provide information and data services such as seismic data collection primarily to the oil & gas industry and distributors of oil & gas equipment products.
This Sub-Industry excludes oil spill services companies classified in the Environmental & Facilities Services Sub-Industry.",101010,Energy Equipment & Services,1010,Energy,10,Energy
10102010,Integrated Oil & Gas,"Integrated oil companies engaged in the exploration
@alloy
alloy / Pure vs Fragmentized Component Trees and Propagated vs Connected Data Propagation.svg
Last active April 12, 2022 11:28
I’ve been drawing up an overview of pure vs GraphQL fragmentized [React] UI components, different ways to propagate data through the tree, and the associated maintenance/performance considerations.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AugustoCalaca
AugustoCalaca / UserList.spec.tsx
Created November 5, 2019 15:04
Simple test using relay-test-utils and react-testing-library
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import { MockPayloadGenerator } from 'relay-test-utils';
import UserListDefault from '../UserList';
import Environment from 'path/to/Environment';
afterEach(cleanup);
describe('<UserList />', () => {
it('should reject query', () => {
@timc13
timc13 / gist:e44f929a95abc999f95de62d38b6777e
Last active January 19, 2017 23:15 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git fetch --prune;
$ git branch --remote --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
cut -d"/" -f2- |
xargs git push origin --delete;
@alediaferia
alediaferia / tiny_uploader.js
Last active February 3, 2026 13:51
A tiny snippet for reading files chunk by chunk in plain JavaScript
/*
Copyright (c) 2015-2025 Alessandro Diaferia
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
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@letmaik
letmaik / models_committed.py
Created May 22, 2014 14:54
delete, insert, update events after a commit for SQLAlchemy
from sqlalchemy import create_engine, event, orm
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm.session import Session as SessionBase, object_session
from sqlalchemy.event.api import listen
# The following adds delete, insert, and update events after successful commits.
# SQLAlchemy provides only events after flushes, but not after commits.
# The classes are adapted from Flask-SQLAlchemy.
# see also https://stackoverflow.com/a/12026787/60982
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@igniteflow
igniteflow / test_deferred_task.py
Last active November 6, 2017 19:37
Testing deferred tasks with Django Appengine
from django.test import TestCase
from google.appengine.ext import deferred
from google.appengine.ext import testbed
from foo.tasks import fake_task
class TasksTest(TestCase):
@alanhamlett
alanhamlett / api.py
Last active October 21, 2024 14:30
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 5, 2026 10:16
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx