Skip to content

Instantly share code, notes, and snippets.

View christianroman's full-sized avatar

Christian Roman christianroman

  • Mexico
View GitHub Profile
@christianroman
christianroman / apple-pay-mexico.sh
Created October 20, 2020 15:35
Apple Pay Mexico
#!/bin/bash
#  Country code
CC="MX"
URL="https://smp-device-content.apple.com/static/region/v2/config.json"
HOME_PAGE="https://www.apple.com/mx/apple-pay"
FOUND=false
function check {
RET=$(curl -s $URL | jq .SupportedRegions.$CC)
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)
} catch (t) {
@christianroman
christianroman / FHC1.swift
Last active August 29, 2015 14:13
Facebook Hacker Cup 2015 Qualification Round: Cooking the Books
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()! }
@christianroman
christianroman / gist:16b407f17c81b384cfa1
Last active August 29, 2015 14:08
Auto Layout crash
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 September 2, 2014 22:18
Reset the iOS Simulator from the command line in Xcode 6
# /Applications/Xcode6-Beta7.app/Contents/Developer/usr/bin/simctl
simctl erase C24126D7-51CD-4731-848A-267E711E1ECD
@christianroman
christianroman / ScrollViewController.m
Last active April 7, 2016 07:39
UIScrollView + Auto Layout, no frames no contentSize
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 February 6, 2014 16:18
Facebook Paper clone using Auto Layout and UIScrollView (First attempt)
//
// 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 June 12, 2021 01:09
Rompiendo Captcha de CURP usando Python, OpenCV, Tesseract OCR y Tornado
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):
@christianroman
christianroman / MyController.h
Last active January 1, 2016 08:19
Objective-C trivia
typedef void (^AboutBlock)();
@interface MyController : UIViewController {
AboutBlock aboutBlock;
}
@end
@christianroman
christianroman / CRClient+Requests.h
Last active January 1, 2016 02:19
AFNetworking 2.0, Mantle, NSURLSession API design
//
// 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"