View swig_and_ctypes.py
This file contains 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 types import SimpleNamespace as _G | |
from ctypes import * | |
from ctypes.util import find_library | |
import obspython as S | |
G, ffi = _G(), _G() | |
ffi.obsffi = CDLL(find_library("obs")) # ? PyDLL | |
G.lock = False | |
G.start_delay = 2 | |
G.duration = 0 |
View shader1.lua
This file contains 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
S = obslua | |
local ffi = require"ffi" | |
local C = ffi.C | |
local _OR = bit.bor | |
ffi.cdef[[ | |
typedef struct {int x, y;} Point; | |
bool GetCursorPos(Point *lpPoint); | |
]] | |
RESOLUTION = {2560,1440}; | |
local mouse_pos = ffi.new("Point") |
View audio_level.lua
This file contains 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
local obs = obslua | |
local ffi = require 'ffi' | |
local jit = require 'jit' | |
local obsffi | |
if ffi.os == "OSX" then | |
obsffi = ffi.load("obs.0.dylib") | |
else | |
obsffi = ffi.load("obs") | |
end |
View TriggerHotkeyByName.lua
This file contains 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
local obs = obslua | |
local ffi = require 'ffi' | |
local obsffi | |
if ffi.os == "OSX" then | |
obsffi = ffi.load("obs.0.dylib") | |
else | |
obsffi = ffi.load("obs") | |
end | |
ffi.cdef[[ |
View concurrent.lua
This file contains 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
local obs = obslua | |
local coroutine = require 'coroutine' | |
local math = require 'math' | |
local Timer = {} | |
function Timer:init(o) | |
o = o or {} | |
setmetatable(o,self) | |
self.__index = self | |
return o |
View is_it_group_item_question_mark.lua
This file contains 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
local obs = obslua | |
--- name of a scene item | |
local source_name = '' | |
--- get the name of the current scene | |
local function current_scene_name() | |
local source = obs.obs_frontend_get_current_scene() | |
local name = obs.obs_source_get_name(source) | |
obs.obs_source_release(source) |
View print_properties.lua
This file contains 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
-- https://obsproject.com/forum/threads/how-to-enumerate-script-properties-in-lua.83406/#post-397381 | |
-- create source with name tmp , then add Color Correction filter named color | |
local obs = obslua | |
local ffi = require("ffi") | |
local obsffi | |
ffi.cdef[[ | |
struct obs_source; |
View beep.lua
This file contains 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
local obs = obslua | |
local ffi = require("ffi") | |
ffi.cdef[[ | |
void Beep(int freq,int dur); | |
]] | |
function beep() | |
ffi.C.Beep(7000,300) | |
end |
View init.vim
This file contains 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
call plug#begin() | |
Plug 'folke/tokyonight.nvim' | |
"--------------------------------------------------------------------------------- | |
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' } | |
map <F3> :UndotreeToggle<cr> | |
"--------------------------------------------------------------------------------- | |
Plug 'mhinz/vim-startify',{'on':'Startify'} | |
nnoremap <F4> :Startify <cr> | |
"--------------------------------------------------------------------------------- | |
Plug 'psf/black', {'on':'Black'} |
View read_aiofiles.py
This file contains 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
import aiofiles | |
import asyncio | |
async def red(): | |
print('where did lost ') | |
async with aiofiles.open('data.txt', mode='r') as f: | |
contents = await f.read() | |
return contents | |
events = asyncio.get_event_loop() | |
try: | |
coro = events.run_until_complete(red()) |
NewerOlder