This file contains hidden or 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 go() { | |
var userId = prompt('Username?', 'Guest'); | |
var userData = { name: userId }; | |
tryCreateUser(userId, userData); | |
} | |
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
function userCreated(userId, success) { | |
if (!success) { |
This file contains hidden or 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 go() { | |
var userId = prompt('Username?', 'Guest'); | |
// Consider adding '/<unique id>' if you have multiple games. | |
var gameRef = new Firebase(GAME_LOCATION); | |
assignPlayerNumberAndPlayGame(userId, gameRef); | |
}; | |
// The maximum number of players. If there are already | |
// NUM_PLAYERS assigned, users won't be able to join the game. | |
var NUM_PLAYERS = 4; |
This file contains hidden or 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 getParent(snapshot) { | |
// You can get the reference (A Firebase object) from a snapshot | |
// using .ref(). | |
var ref = snapshot.ref(); | |
// Now simply find the parent and return the name. | |
return ref.parent().name(); | |
} | |
var testRef = new Firebase("https://example.firebaseIO-demo.com/foo/bar"); | |
testRef.once("value", function(snapshot) { |
This file contains hidden or 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
// 04/19/2015 | |
// Jason Romero | Codenamejason | |
// | |
// | |
class IntroToLINQ | |
{ | |
static void Main() | |
{ | |
// The Three Parts of a LINQ Query: | |
// 1. Data source. |
This file contains hidden or 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
private static class RandomOAuthStateGenerator | |
{ | |
private static RandomNumberGenerator _random = new RNGCryptoServiceProvider(); | |
public static string Generate(int strengthInBits) | |
{ | |
const int bitsPerByte = 8; | |
if (strengthInBits % bitsPerByte != 0) | |
{ |
This file contains hidden or 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 pytest | |
from sow_web_codegen.reader.xlsx import XlsxReader | |
from sow_web_codegen.reader.xlsx import XlsxReaderInvalidFileFormatException | |
from tests import EXAMPLE_WORKSHEET_XLSX as example_worksheet | |
def gen_get_value_func(columns, row): | |
def get_column(column): |
This file contains hidden or 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
// Define variables to access each service. Note the usage of | |
// node.js modules via the "require(...)" calls. | |
var services = { | |
countries: require("./countries_service"), | |
regions: require("./regions_service"), | |
cities: require("./cities_service") | |
} | |
function sendResults(res, params, status, statusText, headers, result) { |
This file contains hidden or 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
using System; | |
using Xamarin.Forms; | |
namespace XamarinFormsTestHarness | |
{ | |
public class MasterDetailControlPage : MasterDetailPage | |
{ | |
public MasterDetailControlPage() |
This file contains hidden or 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
/// <summary> | |
/// GetData - To get values | |
/// </summary> | |
/// <param name="value"></param> | |
/// <returns></returns> | |
public string GetData(int value) | |
{ | |
if (value != null) | |
{ | |
value = value * 10; |
This file contains hidden or 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 array1 = [1,2,3]; | |
var array2 = [4,5,6]; | |
window.onload = function() { | |
array1 = array1.concat(array2); | |
// result = array1[1,2,3,4,5,6] | |
} |