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
| #!/usr/bin/env bash | |
| trap_exit() { | |
| if [[ ! -o xtrace ]]; then | |
| rm -rf "$tmp" | |
| fi | |
| } | |
| tmp=$(mktemp -dt) |
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
| def is_at_most_one_fixable_non_decreasing(num_list): | |
| for skip_index in range(len(num_list)): | |
| non_decreasing = True | |
| for idx in range(1,len(num_list)): | |
| if non_decreasing == False: | |
| break | |
| if idx == skip_idx: | |
| continue | |
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
| 1: | |
| [ 9.00e+00 4.00e+00 4.00e+00 -1.00e+00 -4.00e+00 -4.00e+00 0.00e+00] | |
| [ 4.00e+00 9.00e+00 1.00e+00 -4.00e+00 -1.60e+01 0.00e+00 -4.00e+00] | |
| [ 4.00e+00 1.00e+00 9.00e+00 -4.00e+00 0.00e+00 -1.60e+01 -4.00e+00] | |
| [-1.00e+00 -4.00e+00 -4.00e+00 9.00e+00 4.00e+00 4.00e+00 1.60e+01] | |
| [-4.00e+00 -1.60e+01 0.00e+00 4.00e+00 3.60e+01 4.00e+00 4.00e+00] | |
| [-4.00e+00 0.00e+00 -1.60e+01 4.00e+00 4.00e+00 3.60e+01 4.00e+00] | |
| [ 0.00e+00 -4.00e+00 -4.00e+00 1.60e+01 4.00e+00 4.00e+00 3.60e+01] | |
| 2: |
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/sh | |
| # INIT | |
| iptables -F | |
| iptables -X | |
| iptables -t nat -F | |
| iptables -t nat -X | |
| # NAT | |
| iptables -t nat -A POSTROUTING -s192.168.100.0/24 -o eth0 -j MASQUERADE |
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/sh | |
| stat_timeout=0.3 #seconds | |
| for mp in $(mount -t nfs4 | awk '{print $3}'); do | |
| timeout -s kill ${stat_timeout} stat -t "$mp" > /dev/null | |
| if [ $? == 137 ]; then | |
| printf 'unmount %s\n' "${mp}" | |
| #umount -f "${mp}" | |
| else |
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
| eval -save-regs %{/"|^@pf} %{ | |
| set buffer autoreload yes | |
| prompt -password password: p %{ | |
| exec -draft \%"fy | |
| nop %sh{ | |
| echo ${kak_reg_p} | sudo -S sh -c "printf '%s' \"${kak_reg_f}\" | tee ${kak_buffile} >/dev/null" | |
| } | |
| } | |
| } |
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
| ## | |
| ## autochdir.kak by wheatdog | |
| ## Automatically change server's working directory according to the current focus buffer | |
| ## To turn on this option, add `set global autochdir true` in your kakrc | |
| ## | |
| decl bool autochdir | |
| decl str working_folder | |
| def -hidden \ |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <vector> | |
| #include <string> | |
| #include <GL/glew.h> | |
| #include <GLFW/glfw3.h> | |
| #include "controls.hpp" | |
| #include "TRIModel.h" |
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
| # i3 config file (v4) | |
| # Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
| # Set mod key (Mod1=<Alt>, Mod4=<Super>) | |
| set $mod Mod4 | |
| # set default desktop layout (default is tiling) | |
| # workspace_layout tabbed <stacking|tabbed> | |
| # Configure border style <normal|1pixel|pixel xx|none|pixel> |
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
| @echo off | |
| cl -nologo -FC handmade_srt_gen.cpp kernel32.lib |
NewerOlder