Skip to content

Instantly share code, notes, and snippets.

@nagolove
nagolove / plugin.vim
Created April 29, 2019 16:54 — forked from davisdude/plugin.vim
Launch LOVE from vim
" Vim plugin for running LOVE
" Last Change: 2015 May 26
" Maintainer: Davis Claiborne <[email protected]>
" License: This file is placed under public domain.
let s:save_cpo = &cpo
set cpo&vim
if exists( 'g:loaded_lovelaunch' )
finish
$ lspci | grep Network
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
07:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$ lspci -knn | grep Net -A3; rfkill list
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
07:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter [10ec:b822]
[ 9.023695] Bluetooth: hci0: RTL: rtl: examining hci_ver=07 hci_rev=000b lmp_ver=07 lmp_subver=8822
[ 9.024705] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8822b_fw.bin
[ 9.026763] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8822b_config.bin
[ 9.052352] r8822be: module is from the staging directory, the quality is unknown, you have been warned.
[ 9.087249] r8822be: Using firmware rtlwifi/rtl8822befw.bin
[ 9.116494] r8822be: rtlwifi: wireless switch is on
[ 9.131219] Modules linked in: rtlwifi(OE+) snd_hwdep snd_pcm arc4 kvmgt vfio_mdev mdev snd_seq_midi vfio_iommu_type1 snd_seq_midi_event vfio uvcvideo(+) snd_rawmidi aesni_intel(+) r8822be(C) videobuf2_vmalloc btusb nvidia(POE+) aes_x86_64 btrtl videobuf2_memops crypto_simd btbcm snd_seq kvm videobuf2_v4l2 cryptd mac80211 btintel glue_helper videobuf2_common snd_seq_device bluetooth input_leds(+) snd_timer irqbypass videodev intel_cstate drm_kms_helper wmi_bmof intel_wmi_thunderbolt media intel_rapl_perf ecdh_generic hid_multitouch(+) s
@nagolove
nagolove / repo-rinse.sh
Created July 21, 2019 18:46 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
local socket = require 'socket'
function dispatch ()
local i = 1
local timedout = {}
while true do
if threads[i] == nil then
-- больше нет нитей?
if threads[1] == nil then break end
i = 1
./run_benchmarks.sh
~/projects/luavela/tests/iponweb/perf ~/projects/luavela/tests
Total CPU time for capi/chunks/luae_iterate.lua: 59.231s
~/projects/luavela/tests
~/projects/luavela/tests/iponweb/perf ~/projects/luavela/tests
Total CPU time for capi/chunks/lua_next.lua: 83.602s
~/projects/luavela/tests
~/projects/luavela/tests/iponweb/perf ~/projects/luavela/tests
Total CPU time for lapi/table.lua: 0.313s
~/projects/luavela/tests
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux
pi@raspberrypi ~ $ cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
pi@raspberrypi ~ $ sudo aptitude update
Игнор http://mirrordirector.raspbian.org wheezy InRelease
Из кэша http://archive.raspberrypi.org wheezy InRelease
Игнор http://mirrordirector.raspbian.org wheezy Release.gpg
Игнор http://mirrordirector.raspbian.org wheezy Release
Из кэша http://archive.raspberrypi.org wheezy/main armhf Packages

План работы над проектом love(2d). Первоочередные цели и задачи. Дальнейшее развитие. Исправление архитектурных ошибок. Новый цикл развития.

-- 1. Перебор с удалением.
-- Что не так в данном коде, почему он падает с ошибкой и как его можно исправить?
-- Предложить два способа решения
local tbl = {0, 1, 2, 3, 4, 4, 3, 2, 1}
for i = #tbl, 1, -1 do
local v = tbl[i]
if i % 2 == 0 then
table.remove(tbl, i)
end
@nagolove
nagolove / tricks.lua
Last active February 2, 2020 15:28
Some lua snippets for common tasks.
-- pattern from https://stackoverflow.com/questions/5243179/what-is-the-neatest-way-to-split-out-a-path-name-into-its-components-in-lua/12191225#12191225
local path, fname, extension = string.match(arg[2], "(.-)([^\\/]-%.?([^%.\\/]*))$")
-- использование __СПЕЦ_ИМЕН__ глобальных переменных, как условий.
if not __ONCE__ then
local f = lg.getFont()
if f then print(string.format("current font size = %d", f:getHeight())) end
__ONCE__ = true
end