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
<?php | |
public static function RebuildGameCaches($game_id) { | |
wikilog("RebuildGameCaches started"); | |
$game = database_find_by('games', ['game_id' => $game_id]); | |
$records = database_filter_by('records', ['game_id' => $game_id]); | |
// $levels information is not loaded in $records using a join on purpose | |
// to reduce memory usage. | |
$levels = index_by(database_fetch_all(" |
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
<?php | |
require_once("tests/TestHelper.php"); | |
use Symfony\Component\DomCrawler\Crawler; | |
test('pages/home/index', function () { | |
global $_SESSION; | |
$_SESSION = []; |
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
{ | |
"dependencies": { | |
"express": "^4.16.4", | |
"selfsigned": "^1.10.4", | |
"spdy": "^4.0.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
#!/usr/bin/env bash | |
set -e | |
base_url="https://releases.hashicorp.com/terraform" | |
latest_version="$(curl --silent "https://releases.hashicorp.com/terraform/" | sed -ne 's/.*<a href="\/terraform\/\(.*\)\/".*/\1/p' | grep -v "rc\|beta" | head -n1)" | |
current_version="$(terraform -v | sed -ne 's/Terraform v\(.*\)/\1/p')" | |
if [ "$latest_version" != "$current_version" ]; then |
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
GET / endpoints | |
GET /meetups index-meetups | |
POST /meetups create-meetup signed-in | |
GET /meetups/porto-codes show-meetup | |
PUT /meetups/porto-codes update-meetup owns-meetup-or-is-operator | |
POST /session send-login-email | |
GET /talks/porto-codes index-talks |
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
#include <X11/Xlib.h> | |
#include <X11/Xutil.h> | |
#include <X11/cursorfont.h> | |
#include <stdio.h> | |
int main() { | |
int x = 0; | |
int y = 0; | |
Display* display = NULL; |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
filter: null, | |
filteredPeople: Ember.computed('people', 'filter', function() { | |
if (this.get("filter") === null) { | |
return this.get("people"); | |
} else { | |
return this.get("people").filter( | |
(person) => parseInt(person.height, 10) <= this.get("filter"), |
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
"use strict"; | |
var Root = class { | |
constructor(name) { this.name = name; this.getName = this.getName.bind(this); } | |
getName() { return this.name; } | |
getNameOrig() { return this.name; } | |
}; | |
var Child = class extends Root { } |
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
#!/usr/bin/env sh | |
assert() { | |
R="$(tico "$1")" | |
if [ ! "$R" = "$2" ]; then | |
echo "error on tico $1" | |
echo " expected $2" | |
echo " actual $R" | |
exit 1 | |
fi |
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
activate() { | |
py=".env/bin/activate" | |
[ -f "$py" ] && . "$py" | |
js="node_modules" | |
if [ -d "$js" ]; then | |
export _PREV_PATH_WITHOUT_NPM="$PATH" | |
export _PREV_PS1_WITHOUT_NPM="$PS1" | |
export PATH="$(npm bin):$PATH" |
NewerOlder