Skip to content

Instantly share code, notes, and snippets.

View MacKentoch's full-sized avatar
👨‍💻

Erwan DATIN MacKentoch

👨‍💻
  • France
View GitHub Profile
@MacKentoch
MacKentoch / intro.md
Created July 26, 2017 04:35 — forked from derhuerst/intro.md
Installing the Z Shell (zsh) on Linux, Mac OS X and Windows

Installing zsh – the easy way

The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.

Z shell – Wikipedia

Read more about ZSH at An Introduction to the Z Shell.

Choose one of the following options.

Installing Node using NVM on OSX

BEFORE STARTING

IMPORTANT: If you have previously installed node using HomeBrew, ensure that you uninstall it before you proceed:

brew uninstall --force node

To install NVM, clone to the Git repository

How to create an https server?

1. generate a self-signed certificate, run the following in your shell:

openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem

This should leave you with two files, cert.pem (the certificate) and key.pem (the private key).

How to localize an app’s name with InfoPlist.strings

  • In Xcode go to File, New, File..
  • Select iOS (or the platform you are working with), Resource, Strings File, Next.
  • Name the file InfoPlist.strings (case sensitive).
  • If you only plan on having one App name for your project then I recommend placing the file in the same directory as your Localizable.strings file. However, if you have multiple targets and some of them use different app names then you will want to create a separate directory for the InfoPlist.strings file. You will then need to create a separate InfoPlist.strings file for each app name and associate it with the correct target.
  • Select the newly created InfoPlist.strings file and add the following key, value pairs:
"CFBundleDisplayName" = "Your App Name";    // App name as displayed below app icon
"CFBundleName" = "Your App Name"; // Short app name, should be 16 characters or less
@MacKentoch
MacKentoch / admin-template.html
Created July 9, 2017 07:35
basic html 5 admin template with collapsible side menu
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Admin basic template</title>
<style>
body {
margin: 0 !important; /*suppress all default margins*/

adb and fastboot must know

Install android SDK (bottom of the page) or full android studio if you need to develop on android.

fastboot looks like adb but it is used when device is in bootloader (or fastboot).

Check connected devices

adb:

NEXUS 5X: Fix lineage 14.1 OS vendor mismatch error (N2G47F)

Issue is due to the fact that lineage 14.1 bullhead nightlies are based on the 7.1.2 N2G47F (Apr 2017) monthly update from google.

More explanations in xda-developers.

PREREQUISITE

This assumes:

  • you already know a bit about flashing you android device and you already installed TWRP.
@MacKentoch
MacKentoch / GSEventEmitter.h
Created February 20, 2017 19:10 — forked from andybangs/GSEventEmitter.h
Example RCTEventEmitter Subclass
#import "RCTEventEmitter.h"
#import "RCTBridge.h"
@interface GSEventEmitter : RCTEventEmitter <RCTBridgeModule>
+ (BOOL)application:(UIApplication *)application didSightBeacon:(NSString *)beaconID;
+ (BOOL)application:(UIApplication *)application didDepartBeacon:(NSString *)beaconID;
@end
@MacKentoch
MacKentoch / GSEventEmitter.h
Created February 20, 2017 19:10 — forked from andybangs/GSEventEmitter.h
Example RCTEventEmitter Subclass
#import "RCTEventEmitter.h"
#import "RCTBridge.h"
@interface GSEventEmitter : RCTEventEmitter <RCTBridgeModule>
+ (BOOL)application:(UIApplication *)application didSightBeacon:(NSString *)beaconID;
+ (BOOL)application:(UIApplication *)application didDepartBeacon:(NSString *)beaconID;
@end
window.addEventListener('DOMContentLoaded', function() {
console.log('window - DOMContentLoaded - capture'); // 1st
}, true);
document.addEventListener('DOMContentLoaded', function() {
console.log('document - DOMContentLoaded - capture'); // 2nd
}, true);
document.addEventListener('DOMContentLoaded', function() {
console.log('document - DOMContentLoaded - bubble'); // 2nd
});
window.addEventListener('DOMContentLoaded', function() {