Skip to content

Instantly share code, notes, and snippets.

View a7ul's full-sized avatar
🚀

Atul R a7ul

🚀
View GitHub Profile
@a7ul
a7ul / jamf.md
Last active May 31, 2024 15:49
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@a7ul
a7ul / complex.diff
Created June 15, 2018 10:56
blog-on-node-addon-complex-obj
diff --git a/cppsrc/Samples/classexample.cpp b/cppsrc/Samples/classexample.cpp
index 8dfa3cc..834f7ea 100644
--- a/cppsrc/Samples/classexample.cpp
+++ b/cppsrc/Samples/classexample.cpp
@@ -22,8 +22,17 @@ ClassExample::ClassExample(const Napi::CallbackInfo& info) : Napi::ObjectWrap<Cl
Napi::HandleScope scope(env);
int length = info.Length();
- if (length != 1 || !info[0].IsNumber()) {
- Napi::TypeError::New(env, "Number expected").ThrowAsJavaScriptException();
@a7ul
a7ul / reset.css
Created December 16, 2017 07:49
A reset.css for projects using css modules [helpful for react apps] (webpack css-loader with modules: true)
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
:global(html), :global(body), :global(div), :global(span), :global(applet), :global(object), :global(iframe),
:global(h1), :global(h2), :global(h3), :global(h4), :global(h5), :global(h6), :global(p), :global(blockquote), :global(pre),
:global(a), :global(abbr), :global(acronym), :global(address), :global(big), :global(cite), :global(code),
:global(del), :global(dfn), :global(em), :global(img), :global(ins), :global(kbd), :global(q), :global(s), :global(samp),
:global(small), :global(strike), :global(strong), :global(sub), :global(sup), :global(tt), :global(var),
:global(b), :global(u), :global(i), :global(center),
@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 / 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 / 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 / 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 / launchTerminal.js
Last active March 24, 2020 04:18
Launch a command in new terminal - just like react native's metro bundler . This snippet is inspired from react-native source code
const path = require('path');
const childProcess = require('child_process');
const process = require('process');
const shelljs = require('shelljs');
const startServerInNewWindow = () => {
const scriptFile = /^win/.test(process.platform) ?
'startCommand.bat' :
'startCommand.command';
@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 / classexample.cpp
Last active August 18, 2019 09:55
blog-on-node-addon-class-wrapper
/* cppsrc/Samples/classexample.cpp */
#include "classexample.h"
Napi::FunctionReference ClassExample::constructor;
Napi::Object ClassExample::Init(Napi::Env env, Napi::Object exports) {
Napi::HandleScope scope(env);
Napi::Function func = DefineClass(env, "ClassExample", {