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
#ifndef CHECKED_STATIC_CAST_H_ | |
#define CHECKED_STATIC_CAST_H_ | |
#include <limits> | |
namespace checked_static_cast { | |
template<typename T, typename U, bool S> | |
struct StaticCast { }; | |
template<typename T, typename U> |
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
class Pinger (threading.Thread): | |
def __init__(self, reporter): | |
self.reporter = reporter | |
threading.Thread.__init__() | |
daemon = True | |
def run (self): | |
while True: | |
self.reporter.ping() | |
time.sleep(60) |
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
{ | |
"dependencies": { | |
"express": "^4.16.4", | |
"selfsigned": "^1.10.4", | |
"spdy": "^4.0.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
#!/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 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 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 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 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 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 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