Skip to content

Instantly share code, notes, and snippets.

View jackkav's full-sized avatar

Jack Kavanagh jackkav

View GitHub Profile
@jackkav
jackkav / kong-playground.js
Last active October 14, 2021 11:48
Kong playground
// To run `node kong-playground.js`
// To use `http POST :8080 kongConfig='{"_format_version":"1.1","services":[{"host":"mockbin.com","port":443,"protocol":"https","routes":[{"paths":["/"]}]}]}' command='curl http://localhost:8000/status/200'`
const util = require('util');
const http = require('http');
const exec = util.promisify(require('child_process').exec);
async function asyncExec(x) {
try {
const { stdout, stderr } = await exec(x);
console.log('---running:', x);
console.log('stdout:', stdout);
@jackkav
jackkav / index.js
Last active August 17, 2020 16:27 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
/* --- Description ---
Intended to create seed data for testing vitals traffic, using dev portals features
oauth2 application traffic,
key-auth traffic
anonymous traffic
* tested with the following kong config
*
2017-11-27 16:09:49.471 [info][tid:main][RCTCxxBridge.mm:187] Initializing <RCTCxxBridge: 0x1701bdea0> (parent: <RCTBridge: 0x1700a51c0>, executor: (null))
2017-11-27 16:09:49.476571+0800 needle[494:48554] Initializing <RCTCxxBridge: 0x1701bdea0> (parent: <RCTBridge: 0x1700a51c0>, executor: (null))
2017-11-27 16:09:49.509 [warn][tid:main][RCTBridge.m:121] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-11-27 16:09:49.509012+0800 needle[494:48554] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-11-27 16:09:49.529 [warn][tid:main][RCTModuleData.mm:69] Module RCTWeChat requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
2017-11-27 16:09:49.529441+0800 needle[494:48554] Module RCTWeChat requires main queue setup since it overrides `init` but doesn't implement `
import React from 'react'
import styled, { css } from 'styled-components'
// import { Radio as R } from 'antd'
// const RadioButton = R.Button
// const RadioGroup = R.Group
const ExampleButton = styled.div`
display: inline-block;
border-radius: 3px;
padding: 0.25em 1em;
margin: 0 1em;
import React, { Component } from 'react'
import cheerio from 'cheerio'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
0xd14C8A03DD3638EfC92e1dEF2c218F3D37339A49
import React, { Component } from 'react'
import {
Animated,
StyleSheet,
Text,
TouchableWithoutFeedback,
View,
} from 'react-native'
export default class AnimatedSegmentedControl extends Component {
#get date and git commit id
HASH=$(git rev-parse --short HEAD)
BUILDDATE=$(date +%Y%m%d)
#NOTE edit this version number to change release version
NEWVERSION=0.1.$HASH.$BUILDDATE.$BUILD_NUMBER
echo Version: $NEWVERSION
NEWVERSIONNUMBERSTRING="version: '$NEWVERSION',"
OLDVERSIONNUMBERSTRING="version: '.*,"
#!/bin/bash
#set shared scheme because the build needs it
mkdir -p ../build/ios/project/myapp.xcodeproj/xcshareddata/xcschemes/
cp -f ./myapp.xcscheme ../build/ios/project/myapp.xcodeproj/xcshareddata/xcschemes/myapp.xcscheme
cd ../build/ios/project/myapp.xcodeproj
#set project name to match mobile provision certificate
replace 'PRODUCT_NAME = "myapp";' 'PRODUCT_BUNDLE_IDENTIFIER = com.myapp.ios; PRODUCT_NAME = "myapp";' project.pbxproj
cd ../myapp
#!/bin/bash
#sign jar file
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 \
release-unsigned.apk myapp \
-keystore ../../bin/keystore \
-storepass 123456
#remove old signed version
rm -rfv myapp.apk
#pack new apk
zipalign 4 release-unsigned.apk myapp.apk