Skip to content

Instantly share code, notes, and snippets.

View escaroda's full-sized avatar

Escaroda escaroda

View GitHub Profile
@escaroda
escaroda / slugify.js
Last active August 29, 2015 14:22 — forked from mathewbyrne/slugify.js
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@escaroda
escaroda / myview.js
Last active August 29, 2015 14:23 — forked from npaton/myview.js
// <canvas id="resizeCanvas" width="10000" height="10000" style="display:none"></canvas>
Template.myview.events({
"change .image-select": function(e, t) {
// Verify it's an image...
console.time("total");
var img = document.createElement("img");
img.src = window.URL.createObjectURL(e.currentTarget.files[0]);
img.onload = function () {

How to get facebook login working with Meteor and Cordova on iOS

Step 1: Make your local dev site internet accessible

Because there is an issue with OAuth2 login and localhost development, you currently have to deploy your meteor site to be able to test the Facebook login. A nice little workaround for this is to make the local instance of meteor accessible externally.

There is a great online guide for setting up port forwarding with your router and you can check your public external IP here.

For example, If you have an Apple router, simply open up Airport Utility on your Mac and click edit on your router, then go to the Network tab. Under Port Settings click the + icon and select Personal Web Sharing, setting all of the public and private ports to 3000. Make sure the private IP is set to your current computer IP.

# Note: if you want to run multiple meteor apps on the same server,
# make sure to define a separate port for each.
# Upstreams
upstream gentlenode {
server 127.0.0.1:58080;
}
# HTTP Server
server {
@escaroda
escaroda / iso_639-2.json
Last active August 29, 2015 14:26 — forked from franz-josef-kaiser/iso_639-2.json
ISO 639-2 JSON file that contains different international as well as local names for languages. The file is sorted by the ISO 639-2 language codes
{
"aar":
{
"int":["Afar"],
"native":["Afaraf"]
},
"aa":
{
"int":["Afar"],
"native":["Afaraf"]
@escaroda
escaroda / .gitignore
Last active September 11, 2015 10:33 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
@escaroda
escaroda / nginx.conf
Last active September 15, 2015 17:31 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@escaroda
escaroda / angular-router.md
Created October 6, 2017 09:16 — forked from YuliaTsareva/angular-router.md
Angular Router вдоль и поперек - материалы к докладу

Материалы к докладу «Angular Router вдоль и поперек»

@escaroda
escaroda / angular2why.md
Created October 6, 2017 09:16 — forked from YuliaTsareva/angular2why.md
Почему стоит переходить на Angular 2.0. Отличия и особенности - материалы к докладу
@escaroda
escaroda / penrose.html
Created September 2, 2018 18:44
Penrose Tile Visualiser
<!--
This is a quick ui that wraps yurixi's code from https://habr.com/post/359244/
It can save PNG and SVG.
All credit goes to him for doing pretty much all the work here.
-->
<!DOCTYPE html>
<html lang="en">
<html>
<head>