Skip to content

Instantly share code, notes, and snippets.

View akiross's full-sized avatar
🥷
Ninja

Alessandro Re akiross

🥷
Ninja
View GitHub Profile
@mziwisky
mziwisky / Oauth2.md
Last active February 19, 2025 19:08
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@staltz
staltz / introrx.md
Last active March 13, 2025 12:33
The introduction to Reactive Programming you've been missing
@tnarihi
tnarihi / upsampling-with-deconv-layer.ipynb
Last active March 19, 2019 16:11
Upsampling with DeconvolutionLayer in Caffe. Open as a notebook here: http://nbviewer.ipython.org/gist/tnarihi/54744612d35776f53278
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@karpathy
karpathy / min-char-rnn.py
Last active March 13, 2025 12:58
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active February 23, 2025 11:44
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@myme5261314
myme5261314 / rbm_MNIST_test.py
Last active April 10, 2020 06:59
RBM procedure using tensorflow
import tensorflow as tf
import numpy as np
import input_data
import Image
from util import tile_raster_images
def sample_prob(probs):
return tf.nn.relu(
tf.sign(
@tikolakin
tikolakin / fish_alias.md
Last active February 17, 2025 10:33
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

@vote539
vote539 / ot.lua
Last active August 6, 2024 16:27
An implementation of operational transformation in Lua, designed for integration with Redis. See https://blog.sffc.xyz/post/182052412225/operational-tranformation-in-redis
-- Copyright (c) 2016, Shane Carr (ISC License)
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@simonw
simonw / how-to.md
Last active March 12, 2025 10:52
How to create a tarball of a git repository using "git archive"
@devStepsize
devStepsize / slack_webhook_post.py
Last active December 14, 2024 22:20
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests