Skip to content

Instantly share code, notes, and snippets.

View berkedel's full-sized avatar

Akhmad Syaikhul Hadi berkedel

View GitHub Profile
@berkedel
berkedel / Tutorial.md
Created August 1, 2016 07:04
Change your MAC address on iOS 7-8 (not working on iOS 9 atm)

Hi there,

Change your MAC address on iOS 7-8

Changing your MAC address can be extremely useful in some situation. Let me give you a few:

  • You are limited by time on public networks and everyone want more than just 15 minutes of internet.
  • You want to regenerate your UDID
  • A lot of governments rely on this to find you and then intercept your datas. In France for example, secret services have full access to public Wi-Fi and therefore can locate you by using your MAC address.
@berkedel
berkedel / mac-apps.md
Created August 5, 2016 12:14 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@berkedel
berkedel / bundle-react-native-app.md
Last active September 26, 2016 09:14
Bundle React Native App

iOS

  1. Create a bundle
$ react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios
  1. Comment this line in AppDelegate.m,
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
@berkedel
berkedel / firebase-db-connectivity.java
Created January 2, 2017 01:31
How to check Firebase connectivity
DatabaseReference connectedRef = FirebaseDatabase.getInstance().getReference(".info/connected");
connectedRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
boolean connected = snapshot.getValue(Boolean.class);
if (connected) {
System.out.println("connected");
} else {
System.out.println("not connected");
}
@berkedel
berkedel / how-to-set-status-bar-in-swift-3
Created September 3, 2017 16:10
How to set status bar in Swift 3
* Go into `Info.plist` and add a row called `View controller-based status bar appearance` and set its (boolean-only) value to `NO`.
* In app delegate
```
UIApplication.shared.statusBarStyle = .lightContent
```
@berkedel
berkedel / letsencrypt_2017.md
Created September 16, 2017 00:09 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application android:label="@string/app_name">
@berkedel
berkedel / adding_new_webhook_topics.php
Created February 3, 2018 07:38 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@berkedel
berkedel / postgres-cheatsheet.md
Created May 1, 2018 00:03 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)