Skip to content

Instantly share code, notes, and snippets.

@Mizux
Mizux / vrp_multiple_transit.py
Last active March 17, 2025 16:23
VRP With differents speed and autonomy
#!/usr/bin/env python3
"""Vehicles Routing Problem (VRP)."""
from functools import partial
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
# Vehicle 1: slow (speed: 20)
# Vehicle 2: slow (speed: 20)
# Vehicle 3: average (speed: 18)
@Mizux
Mizux / vrptw_collect_deliveries.py
Last active March 17, 2025 16:22
VRPTW with collects and deliveries
#!/usr/bin/env python3
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2
def create_data_model(input_data=None):
"""Stores the data for the problem."""
data = {}
data['distance_matrix'] = [
[
@darcyabjones
darcyabjones / LTR_presentation.ipynb
Last active March 17, 2025 16:21
A quick introduction to learning to rank models.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jlia0
jlia0 / agent loop
Last active March 17, 2025 16:19
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active March 17, 2025 16:10
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@sebjai
sebjai / OrderFlow.ipynb
Created September 26, 2019 21:39
Optimal trading with order-flow and short-term alpha
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbjohnson
benbjohnson / videogen.sh
Created August 28, 2013 23:22
Generate a video of frame numbers.
#!/bin/bash
# Generate the frames
for i in {0..1800}
do
echo "Generating frame $i"
convert -background black -fill white -size 480x320 -pointsize 48 -gravity center label:${i} frame${i}.png
done
# Combine frames into H.264 MP4 video. (29.97fps & 30fps)
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active March 17, 2025 16:05
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@prashantrahul141
prashantrahul141 / breakpoint.cpp
Created March 17, 2025 16:03
software breakpoint in c/c++
volatile int i = 1;
while(i);
// then change i = 0 from debugger
// mind = blown
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 17, 2025 16:03
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL