Skip to content

Instantly share code, notes, and snippets.

@ptmt
ptmt / tokenizer_tests.fs
Created April 3, 2012 15:14
simple fsharp tests
module totify.tests
open NUnit.Framework
open FsUnit
open TinyNLP
let shouldBeTrue a =
Assert.AreEqual(a, true)
[<Test>]
@ptmt
ptmt / Utils.m
Created August 16, 2015 06:47
Taking screenshot on react-native
- (NSURL *) takeScreenshot:(NSString *)imageName {
UIViewController *root = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
UIGraphicsBeginImageContextWithOptions(root.view.bounds.size, NO, [UIScreen mainScreen].scale);
[root.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
NSData *imgData = UIImagePNGRepresentation(image);
UIGraphicsEndImageContext();
@ptmt
ptmt / index.ios.js
Created July 20, 2015 10:16
0.8.0rc2 - rounded View issue
/* @flow */
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Animated
} = React;
@ptmt
ptmt / ci-configure.yml
Last active August 29, 2015 14:03
Ansible playbook for install jenkins + mongo on docker
- hosts: ci
sudo: yes
tasks:
- name: Install Docker on Ubuntu
apt: pkg=docker.io state=present
- name: Rename docker.io to docker
shell: ln -sf /usr/bin/docker.io /usr/local/bin/docker