Skip to content

Instantly share code, notes, and snippets.

View renefs's full-sized avatar
👋

René Fernández renefs

👋
View GitHub Profile
@stewartadam
stewartadam / main.py
Last active March 5, 2024 16:02 — forked from gear11/main.py
Simple Python proxy server based on Flask and Requests with support for GET and POST requests.
"""
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
@peterdemartini
peterdemartini / command.sh
Last active April 28, 2024 02:42
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@remarkablemark
remarkablemark / README.md
Last active November 12, 2023 07:52
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@paulbbauer
paulbbauer / main.js
Last active February 8, 2024 10:42
Electron oAuth Authentication with GitHub API
// 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
@alexpearce
alexpearce / __init__.py
Created October 30, 2014 16:05
A Flask application configured to accept Shibboleth SSO headers to authenticate users.
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)
@alexpearce
alexpearce / ssotutorial.apacheconf
Last active October 21, 2021 02:31
Apache configuration file for a virtual host running Flask behind a uWSGI server, authentication with Shibboleth SSO
# 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
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 .
@scabbiaza
scabbiaza / macros.html
Last active December 14, 2017 08:06 — forked from maximebf/gist:3986659
form_field macros for WTForms, Flask, Bootstrap 3
{% 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) #}
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 2, 2024 12:46
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@badsyntax
badsyntax / nodejs.pp
Created December 19, 2013 15:28
Puppet: Installing node.js via nvm
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']
}