Skip to content

Instantly share code, notes, and snippets.

View talnetd's full-sized avatar

talnetd talnetd

View GitHub Profile
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active June 28, 2024 22:22
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@talnetd
talnetd / vim
Created January 29, 2015 05:42
Just a simple VIM setup
#!/usr/bin
# Lets get started
sudo apt-get update
# Install Vi Improved
sudo apt-get install vim
# Get the NeoBundle to the house
curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh
@morhekil
morhekil / nginx.conf
Created August 14, 2014 12:18
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 29, 2024 09:05
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@prasoonsharma
prasoonsharma / gist:716254
Created November 26, 2010 03:43
Atomic data types in R
# ATOMIC DATA TYPES IN R
# Character
first.name <- "Kirk"
# Integer
age <- 25
# Numeric
hourly_wage <- 27.25