This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "a rust project"; | |
| inputs = { | |
| nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | |
| flake-utils.url = "github:numtide/flake-utils"; | |
| fenix = { | |
| url = "github:nix-community/fenix"; | |
| inputs.nixpkgs.follows = "nixpkgs"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo somagic-capture -n -s | ffmpeg -f rawvideo -video_size 720x480 -framerate 29.97 -vcodec rawvideo -pix_fmt uyvy422 -itsoffset 00:00:01.5 -i - -f pulse -ac 2 -i default `cat /proc/sys/kernel/random/uuid`.avi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How to setup an OpenGL X11 Session without a monitor connected. Useful for servers with a graphics card, but no monitors. | |
| /etc/X11/xorg.conf.d/10-monitor.conf | |
| Section "Monitor" | |
| Identifier "Monitor0" | |
| HorizSync 5.0 - 1000.0 | |
| VertRefresh 5.0 - 200.0 | |
| Modeline "1600x1200" 22.04 1600 1632 1712 1744 1200 1229 1231 1261 | |
| EndSection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| NAME=>>YOUR_APP<< | |
| BASE_DIR=>>YOUR_HOMEDIR<< | |
| RUN_DIR=$BASE_DIR/>>YOUR_PROJECT<< | |
| VENV_DIR=$BASE_DIR/>>YOUR_VENV<< | |
| DAEMON=python | |
| DAEMON_OPTS=$BASE_DIR/>>YOUR-SCRIPT<< | |
| echo "Starting server" $NAME | |
| cd $RUN_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Creates Tables for Volunteer database. | |
| */ | |
| USE Volunteers; | |
| DROP TABLE IF EXISTS Users; | |
| CREATE TABLE Users( | |
| user_id INT NOT NULL AUTO_INCREMENT, | |
| user_name VARCHAR(64), | |
| user_last_picked DATE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| while true; do | |
| fswebcam -S 120 -r 800x600 --save `date +%d_%H%m%S`.jpg # take photo, filename is day_time | |
| for i in {600..1}; do echo $i; sleep 1; done # 600s countdown timer | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Circle { // Class | |
| private double radius; // Variable | |
| private static final double PI = 3.14159; // Constant | |
| public Circle() { radius = 0.0; } // Constructor | |
| public Circle(double radius) { this.radius = radius; } // Constructor with Parameter | |
| // Methods | |
| public double getRadius() { return radius; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Queue import PriorityQueue | |
| import numpy as np | |
| from PIL import Image | |
| import png | |
| im = Image.open('./floormap-crop.png') | |
| #print np.array(im) | |
| print "---" | |
| im = im.convert('L') | |
| im_map = np.array(im) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Queue import Queue | |
| import numpy as np | |
| from PIL import Image | |
| im = Image.open('./map.png') | |
| im.convert('L') | |
| im_map = np.array(im) | |
| #print im_map | |
| all_nodes = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Mostly based on http://www.redblobgames.com/pathfinding/a-star/introduction.html | |
| # Except made functional and put all in one place. | |
| from Queue import Queue | |
| all_nodes = [] | |
| bad_nodes = [(0,0),(9,0),(0,10),(1,10),(2,10),(3,10),(4,10),(5,10),(0,19),(9,19)] | |
| start_node = (1,0) | |
| end_node = (0,18) | |
| for y in range(20): |