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 / 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 / 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 / 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 / macOS-arm-setup.sh
Last active February 4, 2022 09:11
Setting up fresh macOS
# 1. Install Brew (warning: at least read install at first)
cat "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# 2. Install Oh-my-zsh (warning: at least read install.sh at first)
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | cat
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# 4. Install brew packages
brew install mas # appstore done right
@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%'
@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();

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.