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
@catalinmiron
catalinmiron / gulpfile.js
Created February 19, 2014 23:47
Gulpfile with all devdependecies for sass browser sync mincss concat ....
/*******************************************************************************
1. DEPENDENCIES
*******************************************************************************/
var gulp = require('gulp'); // gulp core
sass = require('gulp-sass'), // sass compiler
uglify = require('gulp-uglify'), // uglifies the js
jshint = require('gulp-jshint'), // check if js is ok
rename = require("gulp-rename"); // rename files
concat = require('gulp-concat'), // concatinate js
@catalinmiron
catalinmiron / package.json
Created February 19, 2014 23:49
package.json for gulpfile ( all npm packages for installation )
{
"name": "Custom",
"version": "0.0.1",
"main": "gulpfile.js",
"devDependencies": {
"gulp-rename": "~1.1.0",
"jshint-stylish": "~0.1.5",
"gulp-concat": "~2.1.7",
"gulp-autoprefixer": "0.0.6",
"gulp-minify-css": "~0.3.0",
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;
@catalinmiron
catalinmiron / gh-pages-push.md
Last active August 29, 2015 14:28
git push gh-pages

Run npm install git-push --save-dev;

Create tools/deploy.js file with approximately the following content:

import push from 'git-push';

const remote = {
  name: 'production',
 url: 'http://github.com/user/test.example.com',
@catalinmiron
catalinmiron / entry.jsx
Last active September 28, 2015 10:29
mocha reporter enhancement
/* globals window, document */
var React = require('react'),
Report = require('./components/report.jsx'),
mochaTestDataVarName = require('../lib/mocha-test-data-var-name.js');
require('./../node_modules/bootstrap/dist/css/bootstrap.min.css')
require('./styles/base.css');
var data = window[mochaTestDataVarName];

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 '