Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Lahfa RaitoBezarius

View GitHub Profile
@RaitoBezarius
RaitoBezarius / api_wrapper.js
Created Apr 21, 2016
API wrapper around a magic API which mutates itself while dispatching events
View api_wrapper.js
// Let's say we have three events:
// CONNECTED
// NEW ITEM IN ARRAY
// DELETED ITEM IN ARRAY
// We're a doing a chat with deletion features
// We have an API which is sync'd with our backend.
const API = new SuperAPI()
@RaitoBezarius
RaitoBezarius / index.js
Last active Apr 2, 2016 — forked from gaearon/index.js
Breaking out of Redux paradigm to isolate apps
View index.js
import React, { Component } from 'react'
import Subapp from './subapp/Root'
class BigApp extends Component {
render() {
return (
<div>
{this.props.children}
</div>
)
View test_result
Using rethinkdb binary /home/raitobezarius/rethinkdb/build/release/rethinkdb
Python 2.7 interpreter: /usr/bin/python2.7, driver: /home/raitobezarius/rethinkdb/drivers/python
== Starting: connections/twisted_connection.py2.7 (T+ 0.9 sec)
>>> Failed connections/twisted_connection.py2.7 with exit code None after 0.0 sec (T+ 0.9 sec)
Failed starting testTraceback (most recent call last):
File "./test-runner", line 1436, in run
test.startTest(server=self.server)
File "./test-runner", line 1016, in startTest
self.testProcess = subprocess.Popen(self.command, stdout=self.__console_output, stderr=self.__console_output, preexec_fn=os.setpgrp, env=envVariables)
View gist:192ca354276f7ee91228
Verifying I am +raitobezarius on my passcard. https://onename.com/raitobezarius
View gist:17298c091a10b4bb9dd7
Verifying I am +raitobezarius on my passcard. https://onename.com/raitobezarius
View test_pack.py
import umsgpack
with open('data_python', 'wb') as f:
f.write(umsgpack.packb(('random', 'data')))
View test_unpack.cpp
#include <iostream>
#include <msgpack.hpp>
#include <fstream>
#include <string>
#include <stdexcept>
int main()
{
std::ifstream in("data_python");
std::string file_content;
View Client_Profile.txt
This file has been truncated, but you can view the full file.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
18.60 0.08 0.08 897067 0.00 0.00 Animation::Update()
16.28 0.15 0.07 std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const
11.63 0.20 0.05 6174358 0.00 0.00 std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_data() const
6.98 0.23 0.03 31872 0.00 0.00 std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_rep() const
View client_profile_analyse.txt
This file has been truncated, but you can view the full file.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
25.00 0.06 0.06 std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const
8.33 0.08 0.02 3810203 0.00 0.00 std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_data() const
8.33 0.10 0.02 336808 0.00 0.00 Animation::Update()
8.33 0.12 0.02 71018 0.00 0.00 std::allocator<unsigned int>::allocator(std::allocator<unsigned int> const&)