Skip to content

Instantly share code, notes, and snippets.

View daGrevis's full-sized avatar
⌨️
Keyboard operator

Raitis Stengrevics daGrevis

⌨️
Keyboard operator
View GitHub Profile
" VimL source.
Plug 'Shougo/neco-vim'
Plug 'https://github.com/neoclide/coc-neco'
" CSS source.
Plug 'neoclide/coc-css', {'do': 'yarn install --frozen-lockfile --force'}
" JSON source.
Plug 'neoclide/coc-json', {'do': 'yarn install --frozen-lockfile --force'}
UPDATE "messages"
SET
"meta" = jsonb_set("meta", '{mode}', concat('"', "text", '"')::jsonb),
"text" = concat("nick", ' set ', "text", ' on ', "meta"->>'param');
UPDATE "messages"
SET
"meta" = jsonb_set("meta", '{mode}', concat('"', "text", '"')::jsonb),
"text" = concat("nick", ' set ', "text", ' on ', "meta"->>'param');
tell application "System Events"
tell process "NotificationCenter"
set numwins to (count windows)
repeat with i from numwins to 1 by -1
click button "Close" of window i
click button "Mark as Read" of window i
end repeat
end tell
end tell
function closeNotifications()
local s = [[
tell application "System Events"
tell process "NotificationCenter"
set numwins to (count windows)
repeat with i from numwins to 1 by -1
click button "Close" of window i
end repeat
end tell
end tell
process.on('SIGTERM', async () => {
logger.info(`Received SIGTERM, quitting connections...`)
const state = store.getState()
_.forEach(state.ircClients, ircClient => {
ircClient.quit()
})
await pollUntil(async () => {
aux() {
ps aux | head -n 1
ps aux | grep -i $@ | grep -v 'grep -i'
}
auxpid() {
aux $@ | awk '{print $2}' | tail -n 1
}
! ~ python
Python 2.7.16 (default, Mar 4 2019, 09:01:38)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 'f' in 'foo'
True
>>> keywords = ['foo', 'bar']
>>> text = 'lala foo'
>>> [keyword for keyword in keywords if keyword in text]
['foo']
diff --git a/backend/package.json b/backend/package.json
index 21a1462..166172c 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -9,6 +9,7 @@
"prettier": "^1.14.3"
},
"dependencies": {
+ "@koa/cors": "^2.2.3",
"bcrypt": "^3.0.0",
hs.window.filter.new():setDefaultFilter{}:subscribe(hs.window.filter.windowCreated, function(window)
local windowFrame = window:frame()
local screenFrame = window:screen():frame()
windowFrame.x = screenFrame.x
windowFrame.y = screenFrame.y
windowFrame.w = screenFrame.w
windowFrame.h = screenFrame.h
window:setFrame(windowFrame)
end)