Skip to content

Instantly share code, notes, and snippets.

Avatar

Muhammad Ghazali muhammadghazali

View GitHub Profile
View SomeFragment.java
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 Feb 28, 2014
Bash script to upload your APK to TestFlight via Upload API
View upload-apk-to-testflight.sh
#!/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 Mar 24, 2014
Muhammad Ghazali's Online Notes: Gunakan native method untuk melakukan custom query di sails-mongo
View Gunakan native method untuk melakukan custom query di sails-mongo.js
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 Aug 29, 2015
Muhammad Ghazali's Online Notes: Sails: Setup geospatial index saat bootstraping
View Sails: Setup geospatial index saat bootstraping.js
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
View Chapters of JavaScript Patterns.md

Book Contents

  • Chapter 1: Introduction
    • Patterns
    • JavaScript concepts
    • ECMAScript 5
    • JSLint
    • The Console
  • Chapter 2: Essentials
  • Writing Maintainable Code
View Notes on UI-Router.md

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 Jul 7, 2014
Muhammad Ghazali's Online Notes: Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
View Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a.md
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
View host-side-profile.xml
<!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 Sep 20, 2014
ignore all the files inside upload directory
View ignore all the files inside upload directory.md
# 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