Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am aantonop on github.
  • I am aantonop (https://keybase.io/aantonop) on keybase.
  • I have a public key ASBrgyjIGUGoCIINvfYXSj1X4F6y40UCVfUIOv8fTDAYAgo

To claim this, I am signing this object:

View rendered.html
<ul class="list-group">
<li class="list-group-item">Style encapsulation and abstraction</li>
<li class="list-group-item">Component wrapping</li>
<li class="list-group-item">High order component</li>
</ul>
View FizzBuzz.cpp
#include<iostream>
int main(){
using namespace std;
for(int i=1; i<101; i++){
if(i%3==0){
cout<<"Fizz";
}
if(i%5==0){
cout<<"Buzz";
}
View parse_method.rb
def self.parse(string)
commands = string.split("\n")
rover = new(*commands.delete_at(0).split(' '))
output = ''
commands.each_slice(2) do |deploy_coords, instructions|
rover.deploy(*deploy_coords.split(' '))
output << rover.process(instructions) + "\n"
end
output
 end
View apply_log.py
import redbaron
import re
logfunctions = ['info', 'warning', 'error', 'critical', 'exception']
#If you dont use the logger.info('text',...) format, change this code
def should_handle(node):
parent = node.parent
View index.html
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>A Pen by Pablo Mariño</title>
View command_where_to_turn.rb
def process(commands)
commands.each_char do |character|
case character
when 'L' then turn_left
when 'R' then turn_right
when 'M' then move_forward
end
end
[@x, @y, @face].join(' ')
View CountVectorizer_example2.py
from sklearn.feature_extraction.text import CountVectorizer
train_X = ["John likes to watch movies",
"Mary likes movies too",
"Joe only likes horror movies and action movies"]
vectorizer = CountVectorizer(token_pattern=r'\b\w+\b') # take a word as a token.
train_vector = vectorizer.fit_transform(train_X) # Learn the vocabulary dictionary and return term-document matrix.
token_set = vectorizer.get_feature_names() # the vocabulary dictionary: ['action', 'and', 'horror', 'joe', 'john', 'likes', 'mary', 'movies', 'only', 'to', 'too', 'watch']
View demoError.sol
pragma solidity ^0.4.0;
contract demoError{
function demoAssert(){
assert(1==2);
}
function demoThrow(){
throw;
View hangman2.ts
function hangman2(secretWords: string, ...letters: string[]) {
return secretWords.split('').every(char => letters.includes(char))
}