Skip to content

Instantly share code, notes, and snippets.

View portokallidis's full-sized avatar

Nick Portokallidis portokallidis

View GitHub Profile
Verifying my Blockstack ID is secured with the address 196MYYyBoEeQ1B2nWUZhfyG3EmFjWg4vUC https://explorer.blockstack.org/address/196MYYyBoEeQ1B2nWUZhfyG3EmFjWg4vUC
@portokallidis
portokallidis / App.js
Created May 25, 2017 13:22 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>

Keybase proof

I hereby claim:

  • I am portokallidis on github.
  • I am nporto (https://keybase.io/nporto) on keybase.
  • I have a public key ASCnua9IOecG4eyVpLwKcH4MsVzPOmbZcHXJ1yHg7zmmyAo

To claim this, I am signing this object:

@portokallidis
portokallidis / vim-on-heroku.sh
Created October 12, 2016 11:36 — forked from naaman/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
mkdir vim
curl https://s3.amazonaws.com/heroku-vim/vim-7.3.tar.gz --location --silent | tar xz -C vim
export PATH=$PATH:/app/vim/bin
@portokallidis
portokallidis / cloudflare-update-record.sh
Created September 16, 2016 23:55 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
#C9 mongodb
sudo apt-get install -y mongodb-org && mkdir local_mongodb_data && echo 'mongod --bind_ip=$IP --dbpath=local_mongodb_data --nojournal --rest "$@"' > run_mongo && chmod a+x run_mongo && ./run_mongo
@portokallidis
portokallidis / loopback ng-admin pagination and filters
Last active January 28, 2016 20:39
Pagination and Filter Configuration Extra for ng-admin+loopback API server
// Pagination and Filter Configuration Extra for ng-admin+loopback API server
// Loopback.io API Mapping
app.config(['RestangularProvider', function (RestangularProvider) {
function Get(yourUrl){
var Httpreq = new XMLHttpRequest();
Httpreq.open("GET",yourUrl,false);
Httpreq.send(null);
return Httpreq.responseText;
};
var obj = {a: 123, b: "4 5 6"};
// <a id="downloadButton" href="" download="filename.json">download JSON</a>
document.getElementById('downloadButton')
.href="data:text/json;charset=utf-8,"
+encodeURIComponent(JSON.stringify(obj))
<!--
This code is a working example of the code shown in the 12devs[0]'s article:
"Rapid Prototyping with AngularJS"[1] by Tom Ashworth[2].
I put it here for reference ;-)
[0] http://12devs.co.uk
[1] http://12devs.co.uk/articles/rapid-prototyping-with-angularjs/
[2] http://twitter.com/phuunet
@portokallidis
portokallidis / html5
Created September 6, 2013 15:51 — forked from elmousa/html5
html5