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 Mammal() {}; | |
Mammal.prototype.sayHello = function() { | |
alert("Hello from mammal"); | |
} | |
// inheritance step 1 | |
function Cat() { | |
Mammal.call(this); | |
} | |
// inheritance step 2 (extends) | |
Cat.prototype = Object.create(Mammal.prototype); |
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
ECMAScript Reference | |
This reference contains a list of built-in objects, functions and properties supported by Qt Script. For a detailed description, see the ECMA-262 specification. | |
The Global Object | |
Value Properties | |
NaN | |
Infinity | |
undefined |
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
.container { | |
width: 300px; | |
display: flex; | |
background-color: blue; | |
} | |
.fake-sidebar { | |
flex: 0 0 100px; | |
background-color: magenta; | |
} |
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 totalNumberOfFrame - 4; | |
var frameNumber = 0; | |
setInterval(function() { | |
gameFramework.setFrame("sprite1", frameNumber, 64); | |
frameNumber = (frameNumber + 1) % totalNumberOfFrame; | |
}); |
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
package com.example.myproject | |
import java.util.Arrays; | |
import org.apache.commons.lang3.StringUtils; | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println(StringUtils.swapCase(Arrays.toString(args))); | |
} | |
} |
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
<select class="js-data-example-ajax"> | |
<option value="3620194" selected="selected">select2/select2</option> | |
</select> | |
function formatRepo (repo) { | |
if (repo.loading) return repo.text; | |
var markup = "<div class='select2-result-repository clearfix'>" + | |
"<div class='select2-result-repository__avatar'><img src='" + repo.owner.avatar_url + "' /></div>" + |
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
package in.javadigest.encryption; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.security.KeyPair; |
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 com.google.gson.stream.JsonReader; | |
protected T generateData(InputStream inputStream) throws Exception { | |
T t = null; | |
InputStreamReader inputStreamReader = null; | |
BufferedReader bufferedReader = null; | |
JsonReader jsonReader = null; | |
try { | |
inputStreamReader = new InputStreamReader(inputStream); | |
bufferedReader = new BufferedReader(inputStreamReader); |
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
AlertDialog.Builder builder = new AlertDialog.Builder(getDialogContext()); | |
builder.setMessage("Message"); | |
builder.setPositiveButton("Yes", new Dialog.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
Toast.makeText(this, "Yes", Toast.LENGTH_SHORT).show(); | |
dialog.cancel(); | |
} |