Skip to content

Instantly share code, notes, and snippets.

@chiraggshah
chiraggshah / jwtRS256.sh
Created December 7, 2022 16:21 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@chiraggshah
chiraggshah / gmail-github-filters.md
Created April 5, 2022 18:47 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

label: gh-pull-request

[
{
"location": "9617 tara street, dublin, westmeath, 66909",
"email": "[email protected]",
"cell": "081-136-4597",
"picture": "https://randomuser.me/api/portraits/women/62.jpg",
"id": 1,
"first_name": "britney",
"last_name": "sims"
},

node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js line 30

replace version.indexOf('iOS') !== 0 with !version.includes('iOS')

@chiraggshah
chiraggshah / react-native.md
Created November 29, 2017 18:53 — forked from iegik/FAQ.md
React Native tips & tricks

React Native

Android

Different App Icons for Debug and Release builds

mkdir -p android/app/src/debug/
for i in android/app/src/main/res/mipmap-*/*.png ; do convert $i -colorspace Gray `echo "$i" | sed 's/main/debug/'`; done
cp ios/app/Images.xcassets/AppIcon.main.appiconset/ ios/app/Images.xcassets/AppIcon.debug.appiconset/
@chiraggshah
chiraggshah / Child.js
Created August 25, 2016 13:17 — forked from eyesofkids/Child.js
Simple React Lifecycle methods test
import React from 'react'
var Child = React.createClass({
getInitialState: function(){
console.log('Child getInitialState');
return { value: 'start'}
},
getDefaultProps: function(){
console.log('Child getDefaultProps');
@chiraggshah
chiraggshah / react-native-ios-splash.m
Created July 19, 2016 20:26 — forked from benvium/react-native-ios-splash.m
React Native iOS Smooth Splash Screen (when using LaunchScreen.xib)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
...
...
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MyAwesomeApp"
initialProperties:@{}
launchOptions:launchOptions];

config/routes.rb

Create your own registration controller like so ... ([see Devise documentation for the details of overriding controllers here ...][1]) ... which is more elegant way as opposed to doing it via the ApplicationController

devise_for :users, controllers: {registrations: 'users/registrations'}

app/controllers/users/registrations_controller.rb

Override the new method to create a Profile associated with the User model as below ... run the configure_permitted_parameters method before to sanitize the parameters (note how to add nested parameters)

####Finding all files containing a text string on Linux ( Reference ) grep -rnw '/path/to/somewhere/' -e "pattern"