Skip to content

Instantly share code, notes, and snippets.

View grabbou's full-sized avatar
💭
🇦🇪🇺🇸

Mike grabbou

💭
🇦🇪🇺🇸
View GitHub Profile
@grabbou
grabbou / tasks.json
Last active June 30, 2023 13:29
A simple example of launching two long-running processes within Visual Studio Code to make working in monorepo easier
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Expo dev server",
"type": "shell",
"command": "cd ./apps/mobile && yarn start",
"presentation": {
"reveal": "always",
"panel": "new",

Useful VSCode shortcuts

  • Navigate to a symbol in a file - ⌘O (add ":" to group by type)
  • Navigate to a symbol in a project - ⌘T (#)
  • Select line - ⌘I
  • Zen Mode - ⌘K+Z
  • Hide sidebar - ⌘B
  • Open markdown preview - ⌘K+V
  • Go to source file - ⌘ Click
  • Toggle terminal - ⌃`
@grabbou
grabbou / b.json
Last active September 4, 2017 13:23
[
{
"id": "59ad53cc251fe8ea313e877a",
"city": "Rivereno",
"image": "http://fanaru.com/images/club/trivia/t48.png"
},
{
"id": "59ad53ccb8f153a21165386e",
"city": "Bangor",
"image": "http://fanaru.com/images/club/trivia/t48.png"
@grabbou
grabbou / webpack.haul.js
Created March 31, 2017 13:18
Haul config for getting Typescript running
/**
* This is Webpack config you need in order to get
* Typescript up and running
*/
module.exports = ({ platform }, { module }) => ({
// We have two files, index.ios.tsx and index.android.tsx
entry: `./index.${platform}.tsx`,
// We extend default loaders by prepending `ts-loader`
module: {
...module,
@grabbou
grabbou / test.m
Last active April 29, 2016 12:03
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTRootView.h"
import onlyUpdateForKeys from 'onlyUpdateForKeys';
const onlyUpdateForProps = (BaseComponent) => {
const propKeys = Object.keys(BaseComponent.propTypes || {});
return onlyUpdateForKeys(propKeys, BaseComponent);
};
export default onlyUpdateForProps;
import {ActivityViewManager} from 'NativeModules';
ActivityViewManager.share({
text: 'Hey, I have just ordered 10 pizzas from RN app',
exclude: ['airDrop', 'postToFacebook']
});
import {ActivityViewManager} from 'NativeModules';
ActivityViewManager.share({
text: 'Hey, I have just ordered 10 pizzas from RN app'
});
#import "ActivityView.h"
#import "RCTLog.h"
#import "RCTBridge.h"
#import "RCTUtils.h"
#import "RCTUIManager.h"
@implementation ActivityViewManager
@synthesize bridge = _bridge;
// will be caught by promise-middleware
function makeASandwichWithSecretSauce(name) {
return {
types: [],
payload: fetch(...)
}
};
// This is complex one
// BTW, you don't have redux-thunk