Skip to content

Instantly share code, notes, and snippets.

@molinav
molinav / get-pip-py26.py
Created June 15, 2021 09:52
Get functional pip for Python 2.6 (with SNI support)
This file has been truncated, but you can view the full file.
#! /usr/bin/env python2.6
# -*- coding: utf8 -*-
#
# Copyright (c) 2021 Víctor Molina García
# MIT License
#
# Script to install a functional `pip` under Python 2.6 by forcing to
# use `pyOpenSSL`.
#
# Because it is not possible to install packages until having a `pip`
library GetCode {
function at(address _addr) public view returns (bytes memory o_code) {
assembly {
// retrieve the size of the code, this needs assembly
let size := extcodesize(_addr)
// allocate output byte array - this could also be done without assembly
// by using o_code = new bytes(size)
o_code := mload(0x40)
// new "memory end" including padding
mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f))))
@molinav
molinav / install-python.sh
Last active September 6, 2023 18:42
Install almost all Python environments on Ubuntu 20.04
#! /bin/bash
#
# Copyright (c) 2020 Víctor Molina García
# MIT License
#
# Script to install Python environments 2.6+ and 3.2+ using PyEnv
# and the installation steps for OpenSSL 1.0.2 mostly based on the
# information available in the following link:
# http://www.linuxfromscratch.org/blfs/view/7.7/postlfs/openssl.html
#
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 4, 2024 06:51
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@niksumeiko
niksumeiko / git.migrate
Last active April 30, 2024 12:54
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},