Skip to content

Instantly share code, notes, and snippets.

View muhammadghazali's full-sized avatar

Muhammad Ghazali muhammadghazali

View GitHub Profile
<!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 / 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

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

Book Contents

  • Chapter 1: Introduction
    • Patterns
    • JavaScript concepts
    • ECMAScript 5
    • JSLint
    • The Console
  • Chapter 2: Essentials
  • Writing Maintainable Code
@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
@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 / 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 \
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 / 01-angularjs-introduction.md
Last active October 14, 2022 06:19
Notes on AngularJS

What is AngularJS

  • AngularJS is not a library, it's a framework that embraces extending HTML into a more expressive and readable format
  • AngularJS is a structural framework for dynamic web apps
  • A framework that lets you use HTML as your template language and extend HTML's syntax to express your application's components clearly and succinctly
  • Angular is an opinionated framework on how a CRUD application should be built

Use AngularJS to build CRUD application

  • Angular was built for the CRUD application in mind. Games and GUI editors are examples of applications with intensive and tricky DOM manipulation. These kinds of apps are different from CRUD apps, and as a result are probably not a good fit for Angular