Skip to content

Instantly share code, notes, and snippets.

View catalinmiron's full-sized avatar
🎥
https://www.youtube.com/c/catalinmirondev

Catalin Miron catalinmiron

🎥
https://www.youtube.com/c/catalinmirondev
View GitHub Profile
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;

Couchbase Lite with React Native

I went into this expecting a challenge but it was easy. Basically, Couchbase Lite has always had an optional HTTP listener that you can connect to from inside your app at http://lite.couchbase./mydatabase/. React Native has a fine XHR module and encourages using fetch so getting your app to sync can be as easy as adding some API calls to keep JSON in the database.

We haven't done a full example yet, but in the spirit of possiblity, here are quick instructions to connect Couchbase Lite iOS with a React Native app (generated from their cli).

@catalinmiron
catalinmiron / colors.lua
Created April 7, 2016 22:28 — forked from Lerg/colors.lua
147 color names as a Lua table, RGB from 0 to 1.
return {
aliceblue = {0.94117647058824, 0.97254901960784, 1},
antiquewhite = {0.98039215686275, 0.92156862745098, 0.84313725490196},
aqua = {0, 1, 1},
aquamarine = {0.49803921568627, 1, 0.83137254901961},
azure = {0.94117647058824, 1, 1},
beige = {0.96078431372549, 0.96078431372549, 0.86274509803922},
bisque = {1, 0.89411764705882, 0.76862745098039},
black = {0, 0, 0},
blanchedalmond = {1, 0.92156862745098, 0.80392156862745},
@catalinmiron
catalinmiron / prepare_icons.sh
Created April 7, 2016 22:28 — forked from Lerg/prepare_icons.sh
Make all app icons with imagemagick, iOS and Android
#!/bin/sh
base=$1
convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png"
convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png"
convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png"
convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png"
convert "$base" -resize '58x58' -unsharp 1x4 "Icon-Small@2x.png"
convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png"
convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png"
convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png"
@catalinmiron
catalinmiron / index.html
Created July 3, 2016 09:56 — forked from Makeshift/index.html
Cordova OCR using MS Project Oxford Clusterfuck Base64 to Blob and Formdata
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<meta name="viewport" content="user-scalable=yes, initial-scale=0.75, maximum-scale=2, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https:; object-src 'self'; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: https:; media-src 'self'; frame-src 'self'; font-src 'self' data: https:; connect-src 'self' https: http:" />
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https:; object-src 'self'; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: https:; media-src 'self'; frame-src 'self'; font-src 'self' data: https:; connect-src 'self' https:" />
<meta http-equiv="X-WebKit-CSP" content="default-src '
@catalinmiron
catalinmiron / info.plist
Created September 15, 2016 20:45 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@catalinmiron
catalinmiron / Appfile
Created January 20, 2017 19:39 — forked from mmazzarolo/Appfile
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "me@gmail.com" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@catalinmiron
catalinmiron / RadioButton.js
Created January 20, 2017 19:44 — forked from mmazzarolo/RadioButton.js
Simple animated stateless React-Native radio button
import React, { PropTypes } from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { View } from 'react-native-animatable'
const DEFAULT_SIZE_MULTIPLIER = 0.7
const DEFAULT_OUTER_BORDER_WIDTH_MULTIPLIER = 0.2
const RadioButton = ({ size, innerColor, outerColor, isSelected, onPress, ...props }) => {
const outerStyle = {
borderColor: outerColor,
@catalinmiron
catalinmiron / heartbeats.js
Created February 21, 2017 22:28 — forked from andrewvc/heartbeats.js
simple canvas heartbeat monitor
function Heartbeat(context,width,height) {
var h = this;
h.context = context;
h.width = width;
h.height = height;
h.baseline = Math.round(h.height / 2);
h.context.moveTo(h.x, h.y);
h.context.strokeStyle = "#668CFF";