Skip to content

Instantly share code, notes, and snippets.

View manuganji's full-sized avatar
⛑️
Focusing

Manu Ganji manuganji

⛑️
Focusing
View GitHub Profile
@v1vendi
v1vendi / case-insensitive-obj.js
Created February 13, 2020 12:09
Object wrapper for getting fields case-insensitively
View case-insensitive-obj.js
const model = {
normalKey: 1,
coRRupTkey: 2,
innErKey: {
x: 3,
Y: 4
},
aRR: [
{ first: 5 }
]
@smcoll
smcoll / django_migration_pk_to_uuid.py
Last active January 24, 2024 15:55
Django migration converting integer pk table to UUID pk table
View django_migration_pk_to_uuid.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.db import migrations, models
def fill_mymodel_uuid(apps, schema_editor):
db_alias = schema_editor.connection.alias
MyModel = apps.get_model('myapp', 'MyModel')
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
View rename_js_files.sh
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@stepheneb
stepheneb / index.html
Last active June 17, 2023 04:10
D3 Example: zoom, pan, and axis rescale
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
@unbracketed
unbracketed / gist:228457
Created November 7, 2009 01:45
Django virtualenv postactivate hook
View gist:228457
#I usually drop something like this into my virtualenv's postactivate for some
#quick and handy shortcuts to common Django commands.
#This way dropping in to do some work on any arbitrary project is as easy as:
# 1. workon <project name>
# 2. djr
cd /path/to/site/root
#Django command shortcuts
alias dj='python manage.py'