Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / flamp.fix.user.js
Created May 10, 2012 08:28
flamp.fix.user.js
// ==UserScript==
// @name flamp_fix
// @description save entire textarea in localStorage
// @version 0.1.0
// @namespace http://potomushto.com
// @include http://*.flamp.ru/*
// @match http://*.flamp.ru/*
// ==/UserScript==
// http://userscripts.org/scripts/show/89824
@ptmt
ptmt / generate_assets.js
Last active August 24, 2016 15:23
node --harmony utils/generate_images.js
'use strict';
const IMAGES_DIR = './images'
const ASSETS_DIR = './iOS/Images.xcassets'
const EXTENSIONS = ['jpg', 'jpeg', 'png']
var fs = require('fs')
var gm = require('gm')
function convertAndCopy(source, scaleFactor, imageName, imageExt) {
let per = scaleFactor === 3 ? '100%' : scaleFactor === 2 ? '50%' : '25%'

Proposal for lightning talk at Reactive Conference.

===

Use case for react-native-macos

React Native for macOS (a.k.a React Native Desktop) started as an experiment a year ago, just out of curiousity and the active stage of development also took place during the previous Reactive conference right in the hotel room in Bratislava.

5 minutes talk about why you probably haven't heard about any real desktop application based on RN, and for what kind of applications it might be perfect fit.

/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
@ptmt
ptmt / packages.config
Last active May 21, 2017 22:58
owin self-hosted blank project in F#
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Owin" version="1.1.0-beta2" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="1.1.0-beta2" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Owin.Extensions" version="0.8.5" targetFramework="net45" />
<package id="Owin.Types" version="0.8.5" targetFramework="net45" />
</packages>
@ptmt
ptmt / rn-cli.config.js
Last active August 1, 2017 12:18
Symlinks workaround with wml
const { execSync, spawn } = require('child_process');
if (process.argv.indexOf('start') > -1) {
console.log('Setting up wml');
const wmlBin = path.join(__dirname, 'node_modules/.bin/wml');
try {
console.log(execSync(`${wmlBin} rm all`).toString());
console.log(
execSync(
`${wmlBin} add ${__dirname}/../module ${__dirname}/node_modules/module --skip-prompt=true`