Skip to content

Instantly share code, notes, and snippets.

@mjmaix
mjmaix / .vscode launch.json
Last active May 6, 2019 10:52
Debug TypeScript and TS Mocha files VSCode configuration using TS-Node
{
"version": "0.2.0",
"configurations": [
{
"name": "Current TS File",
"type": "node",
"request": "launch",
"args": ["${file}"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
@mjmaix
mjmaix / package.json
Created April 26, 2019 12:00
React Native Debugger
{
"scripts": {
"debugger": "./scripts/run-debugger.sh",
"ios": "npm run debugger && react-native run-ios",
"android": "npm run debugger && react-native run-android",
}
}
@mjmaix
mjmaix / package.json
Last active October 5, 2020 18:23
React Native cleanup scripts
{
"scripts": {
"cleanup:all": "npm run cleanup:android && npm run cleanup:react && npm run cleanup:metrobundler && npm run cleanup:hastecache && npm run cleanup:ios",
"cleanup:react": "./scripts/killpackager.sh && watchman watch-del-all && rm -rf node_modules/ && rm -rf $TMPDIR/react-* ~/.npm/ ~./rncache",
"postcleanup:react": "echo 'run `npm install` or `yarn install`'",
"cleanup:ios": "rm -rf ~/Library/Developer/Xcode/DerivedData/* ios/build ios/Pods",
"cleanup:android": "./scripts/cleanandroid.sh",
"cleanup:metrobundler": "rm -rf /tmp/metro-bundler-cache-*",
"cleanup:hastecache": "rm -rf /tmp/haste-map-react-native-packager-*",
"start": "node node_modules/react-native/local-cli/cli.js start -- --reset-cache",
@mjmaix
mjmaix / console logs and commands
Created October 28, 2018 15:11
console logs and commands for ReactXP and Aws Amplify setup
MJA-MBP:sample-app mick$ amplify init
Note: It is recommended to run this command from the root of your app directory
? Choose your default editor: (Use arrow keys)
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
@mjmaix
mjmaix / ReactXP package.json
Created October 28, 2018 15:02
Generated using `create-rx-app sample-app`, added `build:android` and `build:ios`, added "@babel/runtime" and switch to Xcode legacy build, added `build/` prefix on derived path
{
"name": "sample-app",
"private": true,
"main": "index.js",
"version": "0.0.1",
"scripts": {
"rn-cli": "node node_modules/react-native/local-cli/cli.js",
"start:android": "npm run rn-cli -- run-android",
"start:windows": "npm run rn-cli -- run-windows",
"start:ios": "npm run rn-cli -- run-ios",
@mjmaix
mjmaix / JasperReportBuilder.java
Created April 4, 2016 13:53 — forked from rponte/JasperReportBuilder.java
Automatic compilation of subreports with JasperReports
package br.com.triadworks.controller.relatorios.jasper;
import java.io.ByteArrayOutputStream;
import java.sql.Connection;
import java.util.Map;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporter;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperCompileManager;
@mjmaix
mjmaix / BirthdayDatePicker.java
Created December 10, 2015 06:58
Customized JavaFx DatePicker. Set the start year of the datepicker
DatePicker birthdayDatePicker = new DatePicker() {
@Override
protected Skin<?> createDefaultSkin() {
final DatePickerSkin skin = new DatePickerSkin(
birthdayDatePicker) {
@Override
public Node getPopupContent() {
final DatePickerContent popupContent
@mjmaix
mjmaix / persistence.xml
Last active August 30, 2015 14:02 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->