Skip to content

Instantly share code, notes, and snippets.

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy

Building Python 3.11

This article focuses on building CPython for common Linux server operating systems.

These scripts will be tested in fresh Docker container.

I'll install dependencies from package manager if possible, or I'll try compile myself if that makes sense.

The dependencies doesn't change much between these CPython versions, so Python 3.12 and 3.10

@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

@pcuenca
pcuenca / openelm-coreml.py
Created April 30, 2024 09:55
Convert OpenELM to Core ML (float32)
import argparse
import numpy as np
import torch
import torch.nn as nn
import coremltools as ct
from transformers import AutoTokenizer, AutoModelForCausalLM
# When using float16, all predicted logits are 0. To be debugged.
compute_precision = ct.precision.FLOAT32
compute_units = ct.ComputeUnit.CPU_ONLY
@craiglabenz
craiglabenz / chat_message_render_box.dart
Last active May 10, 2024 12:48
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@txhammer68
txhammer68 / linux.md
Last active May 10, 2024 12:47
Linux Tips

Linux Tips (Debian Based distros)

Some usefull tips i have collected over the years, use at own risk.

  • Users & Groups

    • Add user to group
      sudo usermod -a -G cdrom userName
      sudo usermod -aG vboxsf $USER
  • Change root password
    sudo passwd root

@seignovert
seignovert / zenodo-doi-first-badge.md
Created February 21, 2019 20:02
Setup Zenodo DOI badge before the first release

Setup Zenodo DOI badge before the first release

Zenodo doi badge

Before submitting your first release, identify your Github repo id on Github API at:

https://api.github.com/repos/{user}/{repo}
@mallipeddi
mallipeddi / README
Created November 18, 2010 12:13
OpenVPN setup - server on Ubuntu & Tunnelblick on OS X (Snow Leopard)
# install openvpn
sudo apt-get install -y openvpn
# NAT 192.168.99.1/2 subnet <-> eth0 (interface on server)
sudo modprobe iptable_nat
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -s 192.168.99.1/2 -o eth0 -j MASQUERADE
# generate secret key; scp this key to the client later
@Ridwy
Ridwy / MTAudioProcessingTapSample.swift
Created July 30, 2021 11:21
How to use MTAudioProcessingTap in Swift 5
//
// Created by Chiharu Nameki @Ridwy on 2021/07/30.
//
import UIKit
import AVFoundation
/*
Using MTAudioProcessingTap, you can touch raw audio samples playing with AVPlayer.
This sample code shows how to use MTAudioProcessingTap in Swift 5.
@Minionguyjpro
Minionguyjpro / Activate_Windows_8_8.1_10_and_11_Pro_for_Free.md
Last active May 10, 2024 12:36
Activate Windows 8, 8.1, 10 and 11 Pro for Free

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10