I hereby claim:
- I am hongkheng on github.
- I am wbakura (https://keybase.io/wbakura) on keybase.
- I have a public key whose fingerprint is D3BB 665E 70FD DED8 9D34 5DE3 C464 4096 407C 70C3
To claim this, I am signing this object:
//Moving average | |
// v(t) = a * V(t) + (1-a)*v(t-1) | |
// http://scrollerjs.com/talks/velocity2014/#1 | |
function moveStep () { // triggered every 17ms~ | |
var v = (currentPos - prevPos) / (currentTime - prevTime); // current velocity | |
self.velocity = 0.6 * v + 0.4 * self.velocity; // Applying moving average formmula | |
self.translate(self.x, self.y); // debounce move event from animation | |
requestAnimationFrame(moveStep); |
.surface { | |
transform: translate3d(0,0,y); | |
backface-visibility: hidden; | |
} |
I hereby claim:
To claim this, I am signing this object:
/** | |
* Test script for testing a full sweep of a servo. This is to get the minimum and the maximum degree of the angle. | |
*/ | |
Cylon.robot({ | |
name: 'Servo1', | |
connections: { | |
arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } // hard-coded serial port address | |
}, |
if var topController = UIApplication.shared.keyWindow?.rootViewController { | |
while let presentedViewController = topController.presentedViewController { | |
topController = presentedViewController | |
} | |
// topController should now be your topmost view controller | |
// Dismissing an UIAlertController which is being displayed and setting the topController down one level | |
if topController is UIAlertController { | |
if let vc = topController.presentingViewController { | |
topController = vc | |
vc.dismiss(animated: true, completion: nil) |
npm run pre-build && npm run build_logic && npm run post_build && npm run exit | |
// `&&` for sequential execution | |
// `&` for parrallel execution | |
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
# Asking user input into the cli | |
Then(/^I enter the sms otp$/) do | |
print "Enter the otp digit within 30 seconds?" | |
otp = STDIN.gets | |
wait_for_keyboard | |
keyboard_enter_text otp | |
sleep(STEP_PAUSE) | |
end |
/* | |
This gist explains the several ways to define a React component | |
*/ | |
// Functional components that has no life cycle methods tied to itself | |
// Using the function | |
function SimpleFunction(props) { | |
// passing in the props that is given by React by default | |
return ( | |
<div> |