Skip to content

Instantly share code, notes, and snippets.

Masahiko Tachizono mshk

Block or report user

Report or block mshk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View firebase-email-login.js
handleEmailLogin(event) {
firebaseAuth()
.signInWithEmailAndPassword(this.state.emailField, this.state.passwordField)
.catch(function (error) {
if (error) {
console.error('Error(' + error.code + '): ' + error.message);
}
});
}
View firebase-twitter-login.js
import { firebaseAuth, firebaseDb } from '../../lib/firebase'
constructor(props) {
super(props)
this.provider = new firebaseAuth.TwitterAuthProvider()
}
handleTwitterLogin(event) {
firebaseAuth().signInWithPopup(this.provider)
View firebase-email-signup.js
handleEmailSineup(event) {
firebaseAuth()
.createUserWithEmailAndPassword(this.state.emailField, this.state.passwordField)
.catch(function (error) {
if (error) {
console.error('Error(' + error.code + '): ' + error.message);
}
});
}
View firebase_fetch_once_sample.js
admin.database().ref("/sites")
.orderByChild('user_count')
.startAt(3)
.limitToLast(20)
.once('value')
.then((snapshot) => {
let sites = snapshots.val()
if (sites == null) { return }
for (let site_key in sites) {
@mshk
mshk / gist:6276780
Last active Dec 21, 2015 — forked from matsubo/gist:2543898
Read files under the folder you choose and add them to Evernote as text note. Updated version of https://gist.github.com/matsubo/2543898 . Difference is that this script reads contents of the text files and set them as contents of newly created Evernote notes, instead of adding text files as attachments.
View gist:6276780
set listOfNames to {}
set theFolder to choose folder "Select the source folder"
tell application "Finder"
set filelist to every file of the folder theFolder
repeat with currentFile in filelist
set currentFileName to (the name of currentFile)
set nom to currentFileName
if text -4 of nom is "." then
set currentFileName to (text 1 thru -5 of nom)
@mshk
mshk / gist:2498914
Created Apr 26, 2012
How to get the ip address of network drive mounted via AFP on MacOSX
View gist:2498914
% netstat -a | grep afp
@mshk
mshk / loadComponentsInTiMVC
Created Mar 22, 2012
Load components in TiMVC
View loadComponentsInTiMVC
// loads Resources/mvc/components/myview.js
self.App.loadComponent('myview');
You can’t perform that action at this time.