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 / LC_CTYPE.txt
Created November 20, 2017 21:52
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@javymarmol
javymarmol / getDrawingManagerPolygonPath.js
Created November 21, 2017 11:50
Extract drawingManager polygon path Google Maps on click
var map; // Global declaration of the map
var iw = new google.maps.InfoWindow(); // Global declaration of the infowindow
var lat_longs = new Array();
var markers = new Array();
var drawingManager;
function initialize() {
var myLatlng = new google.maps.LatLng(40.9403762, -74.1318096);
var myOptions = {
zoom: 13,
@javymarmol
javymarmol / addInfoWindowDrawingManager.js
Created November 21, 2017 11:53
Add Info window on drawingManager 'overlaycomplete'
google.maps.event.addListener(drawingManager, 'overlaycomplete', function(event) {
if (event.type == google.maps.drawing.OverlayType.MARKER) {
//event.overlay.setTitle("Hello");
var infowindow = new google.maps.InfoWindow({
content: '<div id="content" onmouseover="updateContent()">Hello</div>',
maxWidth: 10
});
google.maps.event.addListener(event.overlay,'click',function(){
infowindow.open(map,event.overlay);
});
private void getLocation() {
try {
if (canGetLocation) {
Log.d(TAG, "Can get location");
if (isGPS) {
// from GPS
Log.d(TAG, "GPS on");
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
@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);
}
}
}
@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 / 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 / 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);
<!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 / 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: