An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple proxy server, based on original by gear11: | |
https://gist.github.com/gear11/8006132 | |
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough. | |
Usage: http://hostname:port/p/(URL to be proxied, minus protocol) | |
For example: http://localhost:5000/p/www.google.com | |
""" | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on: | |
// http://iamemmanouil.com/blog/electron-oauth-with-github/ | |
// https://github.com/ekonstantinidis/gitify | |
// this version uses https rather than superagent | |
var querystring = require('querystring'); | |
var https = require("https"); | |
// Your GitHub Applications Credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from flask import Flask, session, redirect | |
from flask_sso import SSO | |
def get_user_session_info(key): | |
return session['user'].get( | |
key, | |
'Key `{0}` not found in user session info'.format(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apache server configuration for ssotutorial. | |
# This sets up a Flask application over SSL with CERN SSO authentication via | |
# Shibboleth. | |
# Load the SSL and Shibboleth modules | |
LoadModule ssl_module modules/mod_ssl.so | |
LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_22.so | |
# Disable TRACE HTTP requests on CERN advice | |
TraceEnable Off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX dbo: <http://dbpedia.org/ontology/> | |
PREFIX dbpprop: <http://dbpedia.org/property/> | |
PREFIX dbprop: <http://dbpedia.org/property/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?x ?codigo ?poblacion ?name WHERE { | |
?x rdf:type dbo:Country . | |
?x rdf:type <http://schema.org/Country> . | |
?x dbpprop:iso3166code ?codigo . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro form_field(form, field, print_status=True) -%} | |
{% set has_label = kwargs.pop('has_label', True) %} | |
{% set placeholder = '' %} | |
{% if not has_label %} | |
{% set placeholder = field.label.text %} | |
{% endif %} | |
{% set field_status = '' %} | |
{% if form.errors and (form.submitted or (form.is_submitted() and form.submit.data)) %} | |
{# form.submit.data for support multiple forms on page #} | |
{# form.submitted - manual control for form without button (ajax) #} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class nodejs { | |
exec { 'nvm-install': | |
command => '/usr/bin/curl https://raw.github.com/creationix/nvm/master/install.sh | /bin/sh', | |
creates => '/home/vagrant/.nvm', | |
user => 'vagrant', | |
environment => 'HOME=/home/vagrant', | |
require => Package['curl'] | |
} |
NewerOlder