Skip to content

Instantly share code, notes, and snippets.

View madhugb's full-sized avatar
🎯
Focus

Madhu Balakrishna madhugb

🎯
Focus
View GitHub Profile
@madhugb
madhugb / Readme.md
Created March 27, 2024 05:40
random_block-migration.sql

What?

Adding a new cuid() column is difficult in with prisma because the CUID is generated at prisma layer and not at mysql layer. Here are the scripts that will help you generate CUID in your migration file

Steps

  • Make every .sql file in this gist as an individual migration {folder}/migration.sql file.
  • Make sure to add the migrations in the order of dependency random_block -> cuid -> usage
  • Run the migration 🚀
Verifying my Blockstack ID is secured with the address 1HNa1wxChWzeSCLVkBhkQedFZdadpMKNML https://explorer.blockstack.org/address/1HNa1wxChWzeSCLVkBhkQedFZdadpMKNML

Keybase proof

I hereby claim:

  • I am madhugb on github.
  • I am madhugb (https://keybase.io/madhugb) on keybase.
  • I have a public key whose fingerprint is D6A4 B12A 4723 28EF FE15 E442 DEF6 9BE4 8C40 24D0

To claim this, I am signing this object:

@madhugb
madhugb / save-the-internet.html
Created December 24, 2015 11:17
Feel Free to inject on top of your site
<div style="height:50px;width:100%;text-align:center;margin-top:10px;">
<a href="http://www.savetheinternet.in/" target="_blank" title="Save The Internet">
<img src="https://www.madhugb.com/images/net.jpg" style="position:relative;height:100%;max-width:100%;"/>
</a>
</div>
@madhugb
madhugb / gist:ea039a42dd4cbee8b76b
Created November 20, 2015 04:20
Google plus styles
.nWGHWc.k7iNHb .jxKp7 {
width: 100%;
max-width: 100%;
display:inline-block;
}
.uenjKc{
height:100px;
margin:0px auto;
width:500px;
}
@madhugb
madhugb / gist:9da27506b7c12d5a1887
Created March 30, 2015 05:13
Verifying that +madhu is my openname (Bitcoin username). https://onename.com/madhu
Verifying that +madhu is my openname (Bitcoin username). https://onename.com/madhu
@madhugb
madhugb / tasks.py
Last active August 29, 2015 14:07
Tornado Celery
# I am trying to use `IOLoop` for my `celery worker` instance, and here how it looks like
class MyClass(Base):
def __init__(self):
self._io_loop = IOLoop.instance()
def __del__(self):
@madhugb
madhugb / index.html
Last active December 27, 2015 03:39
Diwali Diya
<!DOCTYPE HTML>
<html>
<style>
.link{
text-decoration:none;
color:#666;
font-size:12px;
}
</style>
<script type="text/javascript" src="./jquery.js"></script>
import os
import sys
path='/var/www/mysite'
if path not in sys.path:
sys.path.append(path)
def application(environ, start_response):
"""