Skip to content

Instantly share code, notes, and snippets.

View muhammadghazali's full-sized avatar

Muhammad Ghazali muhammadghazali

View GitHub Profile
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@muhammadghazali
muhammadghazali / upload-apk-to-testflight.sh
Created February 28, 2014 03:24
Bash script to upload your APK to TestFlight via Upload API
#!/bin/bash
printf "Uploading the package to TestFlight...\n"
curl http://testflightapp.com/api/builds.json \
-F file=@REPLACE_THIS_WITH_RELATIVE_PATH_TO_APK \
-F api_token='REPLACE_THIS_WITH_YOUR_API_TOKEN' \
-F team_token='REPLACE_THIS_WITH_YOUR_TEAM_TOKEN' \
-F notes='Link to your release notes' \
-F notify=True \
@muhammadghazali
muhammadghazali / Gunakan native method untuk melakukan custom query di sails-mongo.js
Created March 24, 2014 15:22
Muhammad Ghazali's Online Notes: Gunakan native method untuk melakukan custom query di sails-mongo
Station.native(function(err, collection) {
collection.find({
location: {
$near: {
$geometry: {
type: "Point",
// coordinates: [longitude, latitude]
coordinates: [50, 50]
}
},
@muhammadghazali
muhammadghazali / Sails: Setup geospatial index saat bootstraping.js
Last active August 29, 2015 13:57
Muhammad Ghazali's Online Notes: Sails: Setup geospatial index saat bootstraping
module.exports.bootstrap = function(cb) {
// setup 2dsphere Index on `foo` collection
Foo.native(function(err, collection) {
collection.ensureIndex({
location: '2dsphere'
}, function(err, result) {
// callbacks gets two parameter:
// - an error object (if an error occured)
// - the name for the newly created index

Book Contents

  • Chapter 1: Introduction
    • Patterns
    • JavaScript concepts
    • ECMAScript 5
    • JSLint
    • The Console
  • Chapter 2: Essentials
  • Writing Maintainable Code

saat melakukan migrasi dari ngRoute ke ui-router, pastikan bahwa service $urlRouteProvider sudah diganti dengan $urlRouterProvider, jika tidak maka akan menghasilkan error sebagai berikut:

Uncaught object angular.js:78
  (anonymous function) angular.js:78
  (anonymous function) angular.js:3809
  forEach angular.js:323
  loadModules angular.js:3775
  createInjector angular.js:3715
 doBootstrap angular.js:1379
@muhammadghazali
muhammadghazali / Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a.md
Created July 7, 2014 15:29
Muhammad Ghazali's Online Notes: Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
07-07 22:27:40.962: E/Trace(8893): error opening trace file: No such file or directory (2)
07-07 22:27:42.882: E/dalvikvm(8893): Could not find class 'gpr', referenced from method gps.a
07-07 22:27:42.882: E/dalvikvm(8893): Could not find class 'gpr', referenced from method gps.a
07-07 22:27:42.882: E/dalvikvm(8893): Could not find class 'gpr', referenced from method gps.a
07-07 22:27:43.582: E/dalvikvm(8893): Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
<!DOCTYPE resources [
<!ELEMENT resources (application)>
<!ELEMENT application (serviceProfile)+>
<!ATTLIST application name CDATA #REQUIRED>
<!ELEMENT serviceProfile (supportedTransports, serviceChannel+) >
<!ATTLIST application xmlns:android CDATA #IMPLIED>
<!ATTLIST serviceProfile xmlns:android CDATA #IMPLIED>
<!ATTLIST serviceProfile serviceImpl CDATA #REQUIRED>
<!ATTLIST serviceProfile role (PROVIDER | CONSUMER | provider | consumer) #REQUIRED>
<!ATTLIST serviceProfile name CDATA #REQUIRED>
@muhammadghazali
muhammadghazali / ignore all the files inside upload directory.md
Created September 20, 2014 16:54
ignore all the files inside upload directory
# we ignore all the files inside upload directory
/*
# then we only include the following files, the rest of the files will be ignored
!.gitignore
!.gitkeep