Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Portokallidis portokallidis

View GitHub Profile
View gist:ff68c96e13c8c63ef02136e57032585d
Verifying my Blockstack ID is secured with the address 196MYYyBoEeQ1B2nWUZhfyG3EmFjWg4vUC https://explorer.blockstack.org/address/196MYYyBoEeQ1B2nWUZhfyG3EmFjWg4vUC
@portokallidis
portokallidis / App.js
Created May 25, 2017 — forked from fdidron/App.js
React Router v4 Auth
View App.js
//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>
View keybase.md

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:

View vim-on-heroku.sh
#!/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 Sep 16, 2016 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
View cloudflare-update-record.sh
#!/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)
View Oneliners setup
#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 Jan 28, 2016
Pagination and Filter Configuration Extra for ng-admin+loopback API server
View loopback ng-admin pagination and filters
// 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;
};
View download json href
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))
View 1-highcharts-cheatsheet.js
// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="https://code.highcharts.com/highcharts.js"></script>
@portokallidis
portokallidis / node-and-npm-in-30-seconds.sh
Created Nov 15, 2015 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh