This gist is created with Peroof, a minimalist yet fancy jsPerf alternative
Visit http://peroof.ak.fish/akfish/fa69801cf894a5d347bed795849e3493 to run this perf live.
#!/bin/sh | |
# Helper | |
safeRunCommand() { | |
typeset cmd="$*" | |
typeset ret_code | |
echo cmd=$cmd | |
eval $cmd | |
ret_code=$? |
if (this.ActiveControl.GetType() == typeof(TextBox)) | |
{ | |
TextBox textBox = (TextBox)this.ActiveControl; | |
String text = ((Label)sender).Text; | |
int pos = textBox.SelectionStart; | |
textBox.Text = textBox.Text.Insert(pos, text); | |
//Fix cursor position | |
textBox.Focus(); | |
textBox.SelectionStart = pos; | |
textBox.SelectionLength = text.Length; |
/// <summary> | |
/// Inject onclick handler to close button | |
/// </summary> | |
private void InjectJS() | |
{ | |
HtmlDocument doc = webContent.Document; | |
HtmlElement closeBtnElement = doc.GetElementById(CloseButtonId); | |
if (closeBtnElement == null) | |
return; |
This gist is created with Peroof, a minimalist yet fancy jsPerf alternative
Visit http://peroof.ak.fish/akfish/fa69801cf894a5d347bed795849e3493 to run this perf live.
import React from 'react' | |
import Hypercube from 'react-hypercube' | |
// Use normal `style` attributes | |
class My3DComponent extends React.Component { | |
render() { | |
return ( | |
<div style={{ | |
width: '800px', | |
height: '800px', |
Injected script has no access to chrome.i18n
namespace. It would be a problem when injected script requires some i18n work.
A solution is describled in this documentation.
The i18n method proposed in this official documentation suggests that develops put all i18n string in messages.json
file.
// flow type alias | |
// see http://flowtype.org/docs/type-aliases.html | |
type MVP = { | |
m: vec4, | |
v: vec4, | |
p: vec4 | |
} | |
@uniform | |
const UFoo _.extends(UMVP, { |
var account = new Account(); | |
var validator = new AccountValidator(); | |
account.Map<validator>( | |
) |
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); | |
String sHeader = httpConnection.getHeaderFieldKey(i); | |
if (sHeader.equals("content-length")) { | |
//Unpredictable | |
//Under the same server setup, the API level before 2.3.3 will return true. | |
//But not this one | |
} | |