Skip to content

Instantly share code, notes, and snippets.

View jasonnathan's full-sized avatar

Jason Nathan jasonnathan

View GitHub Profile
{"version":1,"resource":"file:///Users/jasonnathan/Repos/LCMS/server/application/views_old/admin/permissions.php","entries":[{"id":"HREU.php","source":"searchReplace.source","timestamp":1652751938122},{"id":"iXLs.php","source":"searchReplace.source","timestamp":1652752133751},{"id":"cwkD.php","source":"searchReplace.source","timestamp":1652752955443}]}
@jasonnathan
jasonnathan / install.sh
Created October 3, 2018 09:38 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@jasonnathan
jasonnathan / flatten.js
Created December 6, 2016 10:54
A simple way to flatten an array
const flatten = (arr) => arr.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
);
// es5 version
var flattenES5 = function flatten(arr) {
return arr.reduce(function (a, b) {
return a.concat(Array.isArray(b) ? flatten(b) : b);
}, []);
};
@jasonnathan
jasonnathan / index.jsx
Last active November 18, 2016 02:11
SSR with apollo and meteor-router-ssr
import React from 'react';
import {Meteor} from 'meteor/meteor';
/*
* Had to hack server.jsx in meteor-react-router-ssr to move the `preRender` hook so it runs after
* `wrapperHook` and I had to give it {app} as an extra argument.
*/
import {ReactRouterSSR} from 'meteor/jasonnathan:react-router-ssr';
import ReactHelmet from 'react-helmet';
import AppRoutes from '/imports/routes.jsx';
import ApolloClient, {createNetworkInterface} from 'apollo-client';
@jasonnathan
jasonnathan / mongodb_ssl_with_letsencrypt.md
Created October 8, 2016 03:42 — forked from leommoore/mongodb_ssl_with_letsencrypt.md
MongoDB 3.2.x SSL with Letsencrypt

#MongoDB 3.2.x SSL with Letsencrypt Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

##Set the hostname We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.

http {
proxy_cache_path /tmp/nginx/cache
levels=1:2
keys_zone=main:10m
max_size=1g inactive=1d;
proxy_temp_path /tmp/nginx/tmp;
server {
listen 80;
server_name app.example.com;
@jasonnathan
jasonnathan / index.html
Last active August 29, 2015 14:13
HTML Layout for zoomable user interface
<!--The master layout for a zoomable user interface.
See:
www.scriptstreet.com/building-a-zoomable-user-interface-with-meteorjs-greensock
-->
<nav>
<ul>
<li><a href="#start" id="startMenu">Start</a></li>
<li><a href="#contact" id="contactMenu">Contact</a></li>
<li><a href="#works" id="worksMenu">Start</a></li>
@jasonnathan
jasonnathan / zoomAnimate.js
Last active August 29, 2015 14:13
A GSAP Timeline example for a Zoomable user interface
/**
* This was written in Meteor JS, these globals are directly accessible thanks
* to Meteor's Smart Packages
*
* @globals _, $, TimelineLite, TweenLite
*
* See blog post for further reading:
* www.scriptstreet.com/building-a-zoomable-user-interface-with-meteorjs-gsap
*/
@jasonnathan
jasonnathan / viewportRatio.less
Last active April 18, 2018 08:12
LESS mixin for Viewport Ratio Contrains
/* This version is adapted from http://stackoverflow.com/a/24894523/382536 to
* constrain width to 100% height instead. See blog post for further reading:
* https://www.jasonnathan.com/article/gsap/building-a-zoomable-user-interface-with-meteorjs-gsap
*
* param {Number} @x - width
* param {Number} @y height
*/
.viewportRatio(@x, @y) {
@height:100vh;
@width: (@x * 100vh / @y);

Tutorial: Meteor in Windows using Vagrant

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on steps 8 to 15.

If you have no idea what I’m talking about, I’ve made a tutorial to install Ubuntu Precise x86 through Windows command-line with Meteor very simple to follow