Skip to content

Instantly share code, notes, and snippets.

Avatar

Nur Rony nmrony

View GitHub Profile
@nmrony
nmrony / main.dart
Created Apr 12, 2020 — forked from felangel/main.dart
Bloc with SearchDelegate
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@nmrony
nmrony / git-maven-howto.md
Created Mar 19, 2020 — forked from fernandezpablo85/git-maven-howto.md
how to create your own maven repository on github
View git-maven-howto.md

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository

Cd into it

@nmrony
nmrony / .zshrc
Created Mar 7, 2020
Run Studio 3T 2019.6.0 on Mac without a license
View .zshrc
studio3t() {
nohup java -XstartOnFirstThread -cp /Applications/Studio\ 3T.app/Contents/Resources/app/data-man-mongodb-ent-2019.6.0.jar t3.dataman.mongodb.app.ad >/dev/null 2>&1 &
disown
}
@nmrony
nmrony / Makefile
Created Jan 21, 2020 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
View Makefile
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@nmrony
nmrony / create_scala_app
Last active Nov 1, 2019
Scaffold Scala App in single command with optimal settings
View create_scala_app
#!/usr/bin/env zsh
vared -p 'Project Name?: [hello-world] ' -c NMR_SCALA_PROJECT_NAME
vared -p 'Organization version?: [info.nmrony] ' -c NMR_SCALA_PROJECT_ORG
vared -p 'Project version?: [v1.0.0-SNAPSHOT] ' -c NMR_SCALA_PROJECT_VERSION
vared -p 'Scala version?: [2.13.1] ' -c NMR_SCALA_PROJECT_SCALA_VERSION
NMR_SCALA_PROJECT_NAME=${NMR_SCALA_PROJECT_NAME:-hello-world}
NMR_SCALA_PROJECT_ORG=${NMR_SCALA_PROJECT_ORG:-info.nmrony}
NMR_SCALA_PROJECT_VERSION=${NMR_SCALA_PROJECT_VERSION:-v1.0.0-SNAPSHOT}
NMR_SCALA_PROJECT_SCALA_VERSION=${NMR_SCALA_PROJECT_SCALA_VERSION:-2.13.1}
if [ -d "$NMR_SCALA_PROJECT_NAME" ] ; then
@nmrony
nmrony / README.md
Created Jul 6, 2019 — forked from crypticmind/README.md
Setup lambda + API Gateway using localstack
@nmrony
nmrony / clean-up-boot-partition-ubuntu.md
Created May 8, 2019 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@nmrony
nmrony / git-recover-branch.md
Created May 4, 2019 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted
View git-recover-branch.md

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@nmrony
nmrony / flutter_input_password_toggle.dart
Last active Apr 2, 2019 — forked from slightfoot/input_password_toggle.dart
Input Password Toggle and Form Validation, Above Keyboard Widget, Form Focus, Progress Button, State Separation - 27th March 2019 #HumpDayQandA
View flutter_input_password_toggle.dart
import 'package:flutter/foundation.dart' show ValueListenable; // should be exported by widgets
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(Provider<LoginApi>(
value: LoginApiImpl(),
child: TestApp(),
));
}
@nmrony
nmrony / NavigationPrompt.jsx
Created Jan 23, 2019 — forked from bummzack/NavigationPrompt.jsx
A replacement component for the react-router `Prompt`.
View NavigationPrompt.jsx
import React from 'react';
import {withRouter} from 'react-router-dom';
import PropTypes from 'prop-types';
/**
* A replacement component for the react-router `Prompt`.
* Allows for more flexible dialogs.
*
* @example
* <NavigationPrompt when={this.props.isDirty}>
You can’t perform that action at this time.