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
/* Copyright 2018 Your name | |
* | |
* {{project}} is free software: you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public License as | |
* published by the Free Software Foundation, either version 2.1 of the | |
* License, or (at your option) any later version. | |
* | |
* {{project}} is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
# From A to Server Rendering, 2018 edition | |
-- How do I do this again? | |
Another year, another React app to add server-side rendering support to. For the | |
uninitiated, Server-Side-Rendering in the context of React is the term used to | |
describe the use of React itself to do the first render pass of a web-app on the | |
server and send that to the browser just before it gets the (rather large) JavaScript | |
bundle for your React App. The browser can display the server-rendered page immediately and then continue running your App once it is done with the bundle. | |
Server rendering really is one of those things where its great in theory, |
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
|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27| | |
00 |@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@| | |
01 |@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@| | |
02 |@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@| | |
03 |@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@|@@| | |
04 |@@|..|..|..|..|..|..|..|..|..|..|..|..|@@|@@|..|..|..|..|..|..|..|..|..|..|..|..|@@| | |
05 |@@|..|@@|@@|@@|@@|..|@@|@@|@@|@@|@@|..|@@|@@|..|@@|@@|@@|@@|@@|..|@@|@@|@@|@@|..|@@| | |
06 |@@|..|@@|@@|@@|@@|..|@@|@@|@@|@@|@@|..|@@|@@|..|@@|@@|@@|@@|@@|..|@@|@@|@@|@@|..|@@| | |
07 |@@|..|@@|@@|@@|@@|..|@@|@@|@@|@@|@@|..|@@|@@|..|@@|@@|@@|@@|@@|..|@@|@@|@@|@@|..|@@| | |
08 |@@|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|..|@@| |
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
game_map = list() | |
for i in range(0, 28): | |
sub = [] | |
for j in range(0, 36): | |
sub.append(False) | |
game_map.append(sub) | |
for i in range(0, 28): |
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
@parameterized.expand(_KNOWN_STYLES) | |
def test_suggest_correction_docstring(self, style): | |
"""Correct slplling errors inside docstring.""" | |
def get_replacement(): | |
self._spellcheck_lint("{s}{e}\n\"\"\"splelling mistake\"\"\")\n", | |
style) | |
exception = self.assertRaises(LinterFailure, get_replacement) | |
self.assertEqual(replacement(exception), | |
(2, |
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
static unsigned int COVERAGE_STATISTICS_CACHE_MAGIC = 0xC0432463; | |
static GjsCoverageCacheHeader * | |
create_coverage_statistics_cache(GjsCoverage *coverage) | |
{ | |
GjsCoveragePrivate *priv = (GjsCoveragePrivate *) gjs_coverage_get_instance_private(coverage); | |
gsize allocation_len = calculate_coverage_statistics_cache_len(file_statistics_array); | |
void *allocation = g_malloc(allocation_len); | |
void *allocation_index = allocation; |
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
<link rel="import" href="../core-pages/core-pages.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
#include <boost/container/stable_vector.hpp> | |
#include <boost/timer/timer.hpp> | |
#include <vector> | |
#include <cstring> | |
#include <sys/time.h> | |
#include <iostream> | |
#include <cstdlib> | |
template <typename Container> | |
void randomize (Container &container) |
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
static void | |
test_coverage_data_file_is_overwritten_completely(gpointer fixture_data, | |
gconstpointer user_data) | |
{ | |
GjsDebugCoverageToSingleOutputFileFixture *fixture = (GjsDebugCoverageToSingleOutputFileFixture *) fixture_data; | |
/* Write the string "existing contents" about one hundred times to the file | |
* and check that the new file does not contain any string matching it */ | |
const gchar *existing_contents = "existing_contents\n"; | |
guint i = 0; |
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
typedef struct _ChangeDebugModeData | |
{ | |
guint flags; | |
gboolean enabled; | |
} ChangeDebugModeData; | |
typedef void (*LockAction) (JSContext *context, | |
gpointer user_data); | |
static void |