Skip to content

Instantly share code, notes, and snippets.

Christian Roman christianroman

Block or report user

Report or block christianroman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ReactNative.js
This file has been truncated, but you can view the full file.
__SSTOKENSTRING = "@generated SignedSource<<dbe928e1275c495c1922c1bf063ffb70>>";
! function(e) {
function t(e) {
function t() {
var t = Array.prototype.map.call(arguments, function(e) {
if (null == e) return null === e ? "null" : "undefined";
if ("string" == typeof e) return '"' + e + '"';
try {
return JSON.stringify(e)
@christianroman
christianroman / FHC1.swift
Last active Aug 29, 2015
Facebook Hacker Cup 2015 Qualification Round: Cooking the Books
View FHC1.swift
import Foundation
let location = "~/input.in".stringByExpandingTildeInPath
let content = String(contentsOfFile: location, encoding: NSUTF8StringEncoding, error: nil)!
var lines = split(content, { $0 == "\n"}, maxSplit: Int.max, allowEmptySlices: false)
let cases = lines.removeAtIndex(0)
for (i, n) in enumerate(lines) {
let digits = map(n) { String($0).toInt()! }
View gist:16b407f17c81b384cfa1
Objective: {objective 0x79f56080: <750:560, 251:-24108, 250:384> + <251:1>*0x79f5aff0:IB auto generated at build time for view with fixed frame.marker{id: 84} + <251:1>*0x79f5b0a0:IB auto generated at build time for view with fixed frame.marker{id: 86} + <250:1>*0x79f5d690.marker{id: 225} + <250:1>*0x79f5dd60.marker{id: 227} + <250:1>*0x79f5ecc0.marker{id: 229} + <250:1>*0x79f5ecf0.marker{id: 231} + <250:1>*0x79f5f5c0.marker{id: 221} + <250:1>*0x79f5f5f0.marker{id: 223} + <251:1>*0x79f611d0.marker{id: 122} + <251:1>*0x79f620f0.marker{id: 124} + <251:1>*0x79f62120.marker{id: 126} + <251:-1>*0x79f62150.marker{id: 128} + <251:-1>*0x79f621b0.marker{id: 132} + <251:-1>*0x79f621e0.marker{id: 135} + <251:-1>*0x79f62210.marker{id: 138} + <251:-1>*0x79f62240.marker{id: 140} + <250:1>*0x79f62430.marker{id: 146} + <750:1>*0x79f62460.marker{id: 148} + <250:-1>*0x79f62490.marker{id: 150} + <250:-1>*0x79f624c0.marker{id: 152} + <750:1>*0x79f624f0.marker{id: 154} + <251:1>*0x79f62820.marker{id: 163} + <251:1>*0x79f63430.mar
@christianroman
christianroman / gist:2e86522765badb7682ef
Created Sep 2, 2014
Reset the iOS Simulator from the command line in Xcode 6
View gist:2e86522765badb7682ef
# /Applications/Xcode6-Beta7.app/Contents/Developer/usr/bin/simctl
simctl erase C24126D7-51CD-4731-848A-267E711E1ECD
@christianroman
christianroman / ScrollViewController.m
Last active Apr 7, 2016
UIScrollView + Auto Layout, no frames no contentSize
View ScrollViewController.m
UIScrollView *scrollView = [UIScrollView new];
scrollView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:scrollView];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[scrollView]|"
options:0
metrics:nil
views:@{@"scrollView" : scrollView}]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView]|"
@christianroman
christianroman / HomeViewController.m
Created Feb 6, 2014
Facebook Paper clone using Auto Layout and UIScrollView (First attempt)
View HomeViewController.m
//
// HomeViewController.m
// Stories
//
// Created by Christian Roman on 05/02/14.
// Copyright (c) 2014 Christian Roman. All rights reserved.
//
#import "HomeViewController.h"
#import "StoryView.h"
@christianroman
christianroman / server.py
Last active Sep 3, 2018
Rompiendo Captcha de CURP usando Python, OpenCV, Tesseract OCR y Tornado
View server.py
import tornado.ioloop
import tornado.web
import urllib2 as urllib
from PIL import Image
from cStringIO import StringIO
import numpy as np
import tesserwrap
import cv2
class MainHandler(tornado.web.RequestHandler):
View MyController.h
typedef void (^AboutBlock)();
@interface MyController : UIViewController {
AboutBlock aboutBlock;
}
@end
@christianroman
christianroman / CRClient+Requests.h
Last active Jan 1, 2016
AFNetworking 2.0, Mantle, NSURLSession API design
View CRClient+Requests.h
//
// CRClient+Requests.h
// CRClient
//
// Created by Christian Roman on 20/12/13.
// Copyright (c) 2013 Christian Roman. All rights reserved.
//
#import "CRClient.h"
#import "CRCompletionBlocks.h"
@christianroman
christianroman / labelmaker.py
Created Dec 9, 2013
Facebook Hacker Cup Round 1: Labelmaker
View labelmaker.py
ls, out = [line.strip() for line in open('input')], ''
for t in xrange(1, int(ls[0]) + 1):
st, n = ls[t].split(' ')
n, k, l, p, r = int(n), len(st), 0, 1, ''
while n >= p:
n -= p
p *= k
l += 1
for i in range(l):
r += st[n % k]
You can’t perform that action at this time.