Skip to content

Instantly share code, notes, and snippets.

View akshayjai1's full-sized avatar

Akshay Vijay Jain akshayjai1

View GitHub Profile
@akshayjai1
akshayjai1 / launch.json
Created August 13, 2023 09:46
Next JS Debug configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev:local"
},
{
@akshayjai1
akshayjai1 / index.test.tsx
Created March 14, 2023 12:51
Testing exports from library
import {
Button,
ButtonProps,
BrandComponent,
BrandComponentProps,
Typography,
TypographyProps,
} from './index'
describe('Component exports', () => {
@akshayjai1
akshayjai1 / npmVersionCheck
Created October 28, 2022 07:37
A script that can be added to run before npm start or any other script to enforce a particular npm version
const { exec } = require('child_process');
exec('npm -v', (err, stdout) => {
if (err) throw err;
if (parseInt(stdout) !== 8) {
// NOTE: This can happen if you have a dependency which lists an old version of npm in its own dependencies.
throw new Error(`[ERROR] You need npm version @8 but you have ${stdout}`);
}
});
a = {
"phoenix.edu/degrees/masters.html": [
{
"Feb22": {
"ranks": [
10,
6,
6,
6,
7,
{
"campaign": {
"id": "bacbd5b5-1bbe-415c-8567-1e86ed02542e",
"users": [{
"username": "andrea",
"email": "andrea_jimenez@citationlabs.com",
"last_login": "2022-05-20T10:19:36.214718"
}],
"reports_tasks": [],
"created_date": "2022-03-25T18:40:25.277717",
@akshayjai1
akshayjai1 / log.py
Created May 8, 2022 11:56
logging sql queries for django
LOGGING = {
'version': 1,
'filters': {
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue',
}
},
'handlers': {
'console': {
'level': 'DEBUG',
curl --location --request POST 'http://masspayqa-private-api-ecs-alb-1859042516.eu-west-1.elb.amazonaws.com/api/v1/client/create' \
--header 'Content-Type: application/json' \
--header 'X-ACCESS-TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjgzMjYyMDIsInN1YiI6IjU5M2ZlYmY3N2M1MmJiMjM1N2IyZGY3MSIsImNsaWVudElkIjoiNTkzZmViN2M3YzUyYmIyMzU3YjJkZjZjIiwiaWF0IjoxNjI4MjM5ODAyfQ.NWvIM-iwcxjiDI0yAwATCUUf01fVilmR2WzXjlnJ8lo' \
--header 'X-CLIENT-ID: 593feb7c7c52bb2357b2df6c' \
--data-raw '{
"payoutOptions": {
"rejectOnDebitError": false,
"rejectOnAwaitingFunds": false
},
"cash_payout": {
Last login: Mon Oct 4 10:58:38 on console
akshay@Akshays-MacBook-Pro ~ % cd code/w
akshay@Akshays-MacBook-Pro w % ls
developer-portal wso2am-3.2.0 wso2am-3.2.0.zip
akshay@Akshays-MacBook-Pro w % cd wso2am-3.2.0
akshay@Akshays-MacBook-Pro wso2am-3.2.0 % ls
INSTALL.txt bin release-notes.html tmp
LICENSE.txt business-processes repository updates
README.txt dbscripts resources wso2carbon.pid
XMLInputFactory.properties lib samples
{
"editor.wordWrap": "on",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"prettier.tabWidth": 2,
"prettier.endOfLine": "lf",
"prettier.jsxBracketSameLine": true,
"editor.useTabStops": false,
"git.autofetch": true,
"git.confirmSync": false,
[
{
"code": "AF",
"text": "Afghanistan",
"address_config": {
"city": {"tem": {"label": "City", "field": "city", "sequence": 3}},
"state": {"tem": {"label": "State", "field": "state", "sequence": 4}},
"address1": {
"tem": {"label": "Address Line 1", "field": "address1", "sequence": 1}
},