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 | |
| # This script grabs selected text from X11, open it with goldendict | |
| # and starts to speech | |
| # You can configure a global shortkey through your desktop: | |
| # on XFCE: Keyboard settings > Application Shortcuts | |
| # add new one with command: bash /full/path/of/the/dictme.sh | |
| ### | |
| # Grab selected text from X11 |
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 | |
| # | |
| # Personal workspace switcher | |
| # author: meyt | |
| # | |
| # - Change directory to project path | |
| # - Automatic python virtualenv activate/deactivate | |
| # - Auto-complete | |
| # | |
| # Install |
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
| <template> | |
| <StackLayout :class="classess"> | |
| <FlexboxLayout | |
| flexDirection="row" | |
| :justifyContent="hintIsRtl ? 'flex-end' : 'flex-start'" | |
| class="field-label" | |
| > | |
| <StackLayout | |
| v-if="value_.length > 0" | |
| class="wrapper" |
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
| import * as app from 'tns-core-modules/application' | |
| import { device } from 'tns-core-modules/platform' | |
| export function hideSystemUi () { | |
| if (!app.android || parseInt(device.sdkVersion) < 21) { return } | |
| const androidViewPkg = android.view // eslint-disable-line no-undef | |
| const View = androidViewPkg.View | |
| const window = app.android.startActivity.getWindow() | |
| const decorView = window.getDecorView() | |
| decorView.setSystemUiVisibility( |
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
| if $(cat /proc/cpuinfo | grep -q 'sse4'); then | |
| simdver="sse4" | |
| elif $(cat /proc/cpuinfo | grep -q 'sse3\|pni'); then | |
| simdver="sse3" | |
| else | |
| simdver="sse2" | |
| fi |
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 | |
| for host in `grep -P "^Host ([^*]+)$" $HOME/.ssh/config | sed 's/Host //'`; do | |
| echo "copying to $host" | |
| ssh-copy-id -f -i "$HOME/Downloads/id_rsa.pub" "$host" | |
| 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
| from sqlalchemy import MetaData, Column, Integer, String, ForeignKey | |
| from sqlalchemy.orm import relationship, sessionmaker, scoped_session | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.engine import create_engine | |
| engine = create_engine("sqlite://", echo=False) | |
| session = scoped_session( | |
| sessionmaker( | |
| bind=engine, |
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
| # Use this script to test that your Telegram bot works. | |
| # | |
| # Install the dependency | |
| # | |
| # $ gem install telegram_bot | |
| # | |
| # Run the bot | |
| # | |
| # $ ruby bot.rb | |
| # |
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
| import time | |
| from sqlalchemy import event | |
| class sqlog: | |
| def __init__(self, session_or_engine): | |
| self.engine = ( | |
| session_or_engine.get_bind() | |
| if hasattr(session_or_engine, "get_bind") | |
| else session_or_engine | |
| ) |
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
| """ | |
| Watch active postgres connections and client processes info (name, pid, cmdline) | |
| Note: postgres server and clients must be in same machine. | |
| https://gist.github.com/meyt | |
| requirements: | |
| - psycopg2 >= 2.8.5 | |
| - psutil >= 5.5.1 |