Skip to content

Instantly share code, notes, and snippets.

View romange's full-sized avatar
🇮🇱

Roman Gershman romange

🇮🇱
View GitHub Profile
@romange
romange / 1.cc
Last active September 22, 2017 10:49
gcc unaligned bug
// Compile with:
// g++ -std=c++11 -O3 -mavx 1.cc && ./a.out
#include <vector>
#include <memory>
#include <cstdint>
using namespace std;
__attribute__ ((noinline))
void SerializeTo(const vector<uint64_t>& v, uint8_t* dest) {
@romange
romange / test_s3_code.py
Created March 3, 2016 11:19
mocking out s3 dependency
#!/usr/bin/env python
import boto
import moto, sys
from moto import mock_s3
def my_prod_code(bucket):
for k in bucket.list(prefix='foo'):
print k.name, k.get_contents_as_string()