Q1: What's the perspective service of Sencha
Q2: How to improve Sencha with Sencha service
This file contains 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
/** | |
* This function generates a random Integer between two numbers min and max. | |
*/ | |
function (min, max) { | |
return Math.floor(Math.random() * max) + min; | |
} |
This file contains 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
/** | |
* String replace character at particular index(es) | |
* @param {Int or IntArray} index [index to start] | |
* @param {String} character [character which you want to replace] | |
* @return {String} [Replaced character] | |
*/ | |
String.prototype.replaceAt = function(index, character) { | |
if (typeof index !== 'number' && index instanceof Array !== true) { | |
throw Error('Please pass a number or an array of number as first argument and your index is ' + index); | |
} |
This file contains 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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import isVisible from './isVisible'; | |
class LazyLoad extends React.Components { | |
constructor() { | |
super(); | |
this.props = { | |
distance: 100 | |
}; |
This file contains 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
var script = document.createElement('script'); | |
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/prism.js'; | |
document.body.appendChild(script); | |
var csslink = document.createElement('link'); | |
csslink.setAttribute('rel', 'stylesheet'); | |
csslink.setAttribute('type', 'text/css'); | |
csslink.setAttribute('href', 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism-solarizedlight.css'); | |
document.getElementsByTagName('head')[0].appendChild(csslink); |
This file contains 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
set itermRunning to (application "iTerm" is running) | |
set scriptPath to quoted form of POSIX path of ((path to me as text) & "::" & "start.sh") | |
set user_shell to do shell script "dscl /Search -read /Users/$USER UserShell | awk '{print $2}'" | |
tell application "iTerm" | |
activate | |
if not (exists window 1) or (itermRunning = false) then | |
reopen | |
end if |
This file contains 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 add1(v) { return v + 1; } | |
function isOdd(v) { return v % 2 == 1; } | |
function sum(total,v) { return total + v; } | |
function listReduction(list,v) { | |
list.push(v); | |
return list; | |
} | |
function mapReducer(fn) { |
OlderNewer