Instance | Branch |
---|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//homebrew mysql start | |
/usr/local/Cellar/mysql/5.6.19/bin/mysql.server restart | |
//or | |
mysql.server start | |
//check for access privileges | |
mysqlaccess localhost user database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js'); | |
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js'); | |
import messaging from 'config/firebase' | |
messaging.setBackgroundMessageHandler(function (payload) { | |
console.log('We Received a background message ', payload); | |
const notificationTitle = 'New Background Message Title'; | |
const notificationOptions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import messaging from 'config/firebase' | |
export function initializePush() { | |
messaging | |
.requestPermission() | |
.then(() => { | |
return messaging.getToken(); | |
}) | |
.then(token => { | |
console.log("FCM Token:", token); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Entry point of our app | |
*/ | |
const Component = () => ( | |
<Provider store={store}> | |
<App /> | |
</Provider> | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const removeElement = (list, id) => { | |
const removeIndex = list.findIndex(item => item.id === id) | |
if (removeIndex == -1) { | |
return list; | |
/*Return the original array if you cant find the id to delete*/ | |
} | |
if (removeIndex == 0){ | |
return ...list.slice(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Method 1: | |
class Parent extends Component { | |
state = { foo: '', bar: '', buzz: '' } | |
render() { | |
return ( | |
<Child | |
setParentState={this.setState} | |
> | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rootCommentsCard = [] | |
let repliesCard = [] | |
function arrangeComments(comments){ | |
for (var commentId in comments) { | |
let parent = comments[commentId].parent | |
if (parent[0] == 'root') { | |
comments[commentId].commentId = commentId | |
comments[commentId].replies = [] | |
rootCommentsCard.push(comments[commentId]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let array = [{ | |
name: "John", | |
ranking: 5 | |
}, { | |
name: "Sam", | |
ranking: 4 | |
}, { | |
name: "Timi", | |
ranking: 1 | |
}, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test(){ | |
var h = 'Hello'; | |
var w = 'World'; | |
return w, | |
console.log(f), | |
h; | |
} | |
console.log(this.test()); //World |