Skip to content

Instantly share code, notes, and snippets.

View a7ul's full-sized avatar
🚀

Atul R a7ul

🚀
View GitHub Profile
@a7ul
a7ul / pr.yaml
Created August 3, 2023 17:24
Check if you forgot to create migration in prisma after schema change in Github actions PR
name: Run PR checks
on:
pull_request:
branches:
- "main"
jobs:
checks:
name: Run checks
@a7ul
a7ul / CMakeLists.txt
Created May 26, 2021 16:50
Compile QuickJs binaries using cmake
# Instructions
# ============
# 1. mkdir qjs && cd qjs
# 2. git clone https://github.com/bellard/quickjs.git quickjs
# 3. Copy this file as CMakeLists.txt
# 4. mkdir build && cd build
# 5. cmake .. && make
# 6. You can now find the binaries qjs and qjsc in the build folder.
cmake_minimum_required(VERSION 3.9...3.20)
@a7ul
a7ul / gkejoboperator.py
Last active October 7, 2021 20:44
Airflow operator to create kubernetes jobs in a separate GKE cluster via Airflow
# # Installation
# 1. Copy this gkejoboperator.py in your dag folder.
#
# 2. For this custom operator to be used in the composer env, we need to install these python modules
#
# // requirements.txt
# kubernetes==11.0.0
# pyyaml==5.3.1
#
# 3. Add a connection in airflow for the operator to use for connecting to gke cluster.
@a7ul
a7ul / inject_custom_codepush_bundle.ts
Last active January 4, 2023 04:40
How to load custom codepush bundle for a react native app without using offical codepush servers? This can allow us to load code push bundles from anywhere like a gcs bucket or even local http server.
// How to use it ?
// ===============
// Step 1: Create a custom codepush bundle
// ----------------------------------------
// react-native bundle --assets-dest out --bundle-output out/main.jsbundle --dev false --platform ios --entry-file index.ts
// Then just compress the contents of out dir into a single zip file. for example: out.zip
// Step 2: Create a remotePackage json object
// ------------------------------------------
@a7ul
a7ul / v0.13.0-features.md
Last active January 24, 2020 20:10
List of features in v0.13.0 of NodeGui

Qt Widgets

  • QCalendarWidget
  • QCheckBox
  • QDateEdit
  • QDateTimeEdit
  • QLabel
  • QDial
  • QFileDialog
  • QLineEdit
@a7ul
a7ul / my-complex-component.js
Last active January 27, 2019 23:18
react-webcomponentify-examples-my-button.js
import React from "react";
import { registerAsWebComponent } from "react-webcomponentify";
const MyComplexComponent = props => (
<div>
Kinda complex component 😂
<p>{props.text}</p>
<div>{props.children}</div>
</div>
);
@a7ul
a7ul / my-button.js
Last active January 27, 2019 22:15
react-webcomponentify-examples-my-button.js
import React from "react";
import { registerAsWebComponent } from "react-webcomponentify";
export const Button = props => {
return (
<button
style="height:40px;font-weight:bold;"
id={props.id}
onClick={props.onClick}
>
@a7ul
a7ul / my-input.js
Last active January 27, 2019 22:02
react-webcomponentify-examples-my-input.js
import React from "react";
import { registerAsWebComponent } from "react-webcomponentify";
export class Input extends React.Component {
constructor(props) {
super(props);
this.state = { buttonText: "" };
this.onInputEnter = this.onInputEnter.bind(this);
}
onInputEnter(evt) {
@a7ul
a7ul / app.js
Last active July 15, 2018 11:25
blog-console-web-ui-htmlandconsole
const express = require('express');
const hello = require('./src/ansi/animations/hello');
const PORT = process.env.PORT || 3000;
const app = express();
// simple hello route
app.get('/hello', async (req, res, next) => {
const userAgent = req.headers['user-agent']; // checking the useragent
@a7ul
a7ul / app.js
Last active July 15, 2018 08:07
blog-console-web-ui-animated-example
const express = require('express');
const { Readable } = require('stream');
// This is the special ANSI code to tell terminals to clear the screen
const PAGE_BREAK = '\033[2J\033[H';
// This function gets the current date in string format along
// with a page break on top.
// Note that you would need to add a new line for the terminal to
// interpret it. That is `hello` will not work while `hello\n` will.