Skip to content

Instantly share code, notes, and snippets.

View jrobichaud's full-sized avatar

Jules Robichaud-Gagnon jrobichaud

View GitHub Profile
@Flexonze
Flexonze / test_pgbulk.py
Last active January 19, 2023 21:02
django-pgbulk vs Django's bulk_create and bulk_update
from myapp.models import MyModel
from django.test import TestCase
import pgbulk
from time import perf_counter
class TestPgBulk(TestCase):
@classmethod
def setUpTestData(cls):
cls.number_of_objects = 25_000
@bblanchon
bblanchon / example.py
Created April 9, 2021 09:03
Django Subquery Aggregate (Count, Sum...)
from django.db.models import OuterRef
weapons = Weapon.objects.filter(unit__player_id=OuterRef('id'))
units = Unit.objects.filter(player_id=OuterRef('id'))
qs = Player.objects.annotate(weapon_count=SubqueryCount(weapons),
rarity_sum=SubquerySum(units, 'rarity'))
@tomcanac
tomcanac / react-redux.md
Last active April 3, 2020 16:38
Reads and links to bootstrap your React/ Redux skillz

First, install those two extensions:

  • react dev tools
  • redux dev tools

Ok now you can keep reading!

JavaScript/ ES[0-9]*

@KavenTheriault
KavenTheriault / profiling.md
Created December 23, 2019 15:23
Python memory profiling

Use de "track_memory" decorator on your functions.

@elaberge
elaberge / unitySizeAnalyzer.sh
Created November 4, 2016 22:56
Unity App Size Analyzer
#!/usr/bin/env bash
function dumpBundle {
FILE=$1
OUTDIR=$2
LZMADIR=$3
OUTPATH="$OUTDIR/$FILE"
LZMAPATH="$LZMADIR/$FILE"
mkdir -p $(dirname "$OUTPATH")
@sli
sli / ips.py
Last active January 9, 2024 22:41
Python IPS patcher.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# IPS Patcher
# Copyright (©) itari 2014
# Do whatever you want with this, I don't care. :D
#
# Modified by sli to work on the command line and with
# Python 3. Who even uses Tkinter anymore?
@javierarques
javierarques / protractorAPICheatsheet.md
Last active July 10, 2024 11:24
Protractor API Cheatsheet
@horsman
horsman / FixAssemblys
Created April 29, 2015 16:19
FixUnityAssemblys
using UnityEngine;
using System.Collections.Generic;
using UnityEditor;
using System.Text.RegularExpressions;
using System.IO;
using System.Text;
public class ReimportUnityEngineUI
{
[MenuItem( "Assets/Reimport UI Assemblies", false, 100 )]
@vitorgalvao
vitorgalvao / Right Click.applescript
Last active March 16, 2023 14:30
Make right-clicking on OSX accessible via a keyboard shortcut
(*
A [native solution][1] exists but it suffers from a major flaw: it right-clicks where the cursor is, not what on the selection.
This code addresses that limitation, though it only works on Finder windows and not the Desktop.
You can install it as a [Finder Service, and later asign it a keyboard shortcut][2].
[1]: http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os
[2]: http://www.macosxautomation.com/services/learn/tut01/index.html
*)