Skip to content

Instantly share code, notes, and snippets.

View javymarmol's full-sized avatar

Heyner Javier Marmol Verbel javymarmol

View GitHub Profile
@javymarmol
javymarmol / .gitignore
Last active February 10, 2020 14:40
gitignore for React.js
# Created by .ignore support plugin (hsz.mobi)
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen
### Node template
@javymarmol
javymarmol / .eslintrc
Created February 10, 2020 14:30
configuracion eslint 2019 react
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": ["airbnb"],
"globals": {
"document": false,
"escape": false,
@javymarmol
javymarmol / intent_map_android.java
Created December 31, 2019 03:32
Intent para abrir mapa en android
//Con latitude y longitude
Uri gmmIntentUri = Uri.parse("geo:0,0" + "?q=" + trayecto.getLatitude() + "," + trayecto.getLongitude());
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
// Con dirección
Uri gmmIntentUri = Uri.parse("geo:0,0" + "?q=" + trayecto.getAddress());
@javymarmol
javymarmol / centos_send_mail.txt
Created July 11, 2019 17:39
solve "Connection could not be established with host smtp"?
If your SELinux is in enforcing mode, you need to turn on httpd_can_sendmail and httpd_can_network_connect booleans.
You can verify if SELinux status is enforcing by running this command:
$ sestatus
...
Current mode: enforcing
...
Check status of httpd sendmail and network connect booleans:
@javymarmol
javymarmol / php-dyld.md
Created July 10, 2019 03:57 — forked from hgrimelid/php-dyld.md
php: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib

After upgrading to Node v.10.9.0 via Homebrew the following error message was thrown from PHP:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

Reinstall PHP to fix, for me that's:

<!DOCTYPE html>
<head>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCicFZLn6DdO4QBY0USNvoGSyPeFA3C_Bg&libraries=drawing"></script>
</head>
<body>
@javymarmol
javymarmol / point_into_polygone
Created November 22, 2018 01:09
check point into a a polygone
public function checkCoverage2(Request $request){
$y = $request["lat"];
$x = $request["lng"];
$offices = Office::all();
$inside = false;
foreach ($offices as $office){
$zone = json_decode($office->zone);
@javymarmol
javymarmol / EnableDisableInteraction.java
Last active May 25, 2018 21:00
Enable Disable interaction for user android
//to block user touch events
getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
//To get user interaction back
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
@javymarmol
javymarmol / restoringFragment.java
Created May 10, 2018 15:58
restore existing fragment
private void changeFragment(Fragment f, String tag) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
if (fragmentManager.findFragmentByTag(tag) == null) {
fragmentTransaction.add(R.id.frameContainer, f, tag);
} else {
f = fragmentManager.findFragmentByTag(tag);
fragmentTransaction.replace(R.id.frameContainer, f, tag);
}
fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).commit();
@javymarmol
javymarmol / enableDisableView.java
Created May 10, 2018 15:26
enable o disable view in android
public static void enableDisableView(View view, boolean enabled) {
view.setEnabled(enabled);
if ( view instanceof ViewGroup ) {
ViewGroup group = (ViewGroup)view;
for ( int idx = 0 ; idx < group.getChildCount() ; idx++ ) {
enableDisableView(group.getChildAt(idx), enabled);
}
}
}