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
class Car { | |
var plate: String | |
var driver: Driver? | |
init(plate: String) { | |
self.plate = plate | |
} | |
} | |
class Driver { |
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
# combination of steps from | |
# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu | |
# and | |
# https://seanthegeek.net/455/how-to-compile-and-install-ffmpeg-4-0-on-debian-ubuntu/ | |
response= | |
echo -n "Do you want to compile the optional libpulse as well (yes/no) > " | |
read response |
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
# HIGHEST TIME CONSUMING QUERY AT PRESENT | |
select ID,INFO,COMMAND,STATE, TIME from information_schema.processlist where STATE != 'Sleep' and COMMAND!='Sleep' order by TIME desc limit 1\G |
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
SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES where table_schema = "<YOUR_DATABASE_NAME_HERE>" ORDER BY (data_length + index_length) DESC; |
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
''' | |
This test runner flushes the test db after all tests are run, and retains the schema (all tables will be truncated) | |
You can safely run all tests using --keepdb (recommended) parameter where in it will only keep the schema , but not the actual data | |
This saves times in frequent test runs as the entire test db schema doesnt have to be recreated every time | |
note that this will still apply newer migrations (if any) from last known point when the tests were run | |
if you actually want to retain test data, then do not use this test runner | |
''' |
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
# inspired from http://www.andymboyle.com/2011/11/02/quick-csv-to-json-parser-in-python/ | |
# refactored for using in python-3 | |
# Also added ability to change json lib easily within json, ujson, simplejson | |
# reference for performance comparison json, ujson, simplejson - of https://medium.com/dataweave/json-vs-simplejson-vs-ujson-2887b2c128b2 | |
import csv | |
import importlib | |
# you can use 'json', 'ujson' or 'simplejson' | |
json_lib_name = 'json' |
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
{ | |
"python.linting.enabled": true, | |
"python.linting.lintOnSave": true, | |
"python.linting.pylintEnabled": true, | |
"python.linting.pylintPath": "/Users/abc/Envs/venv/bin/pylint", | |
"editor.formatOnSave": true, | |
"python.formatting.yapfPath": "/Users/abc/Envs/venv/bin/yapf", | |
"python.formatting.provider": "yapf", | |
"python.formatting.yapfArgs": [ | |
"--style", |
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
[MASTER] | |
# reference : https://raw.githubusercontent.com/google/yapf/master/pylintrc | |
# Specify a configuration file. | |
#rcfile= | |
# Python code to execute, usually for sys.path manipulation such as | |
# pygtk.require(). | |
init-hook='import sys; sys.path.append(".");' |
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
# Tested on ubuntu-18 and mac os x (mojave) | |
# I also tried the ssh compressed way of doing things, but this is much simpler | |
# There might be better combinations available, please leave a comment and I shall test and update this gist | |
rsync -vaHxPz username@IP:SOURCE_PATH DESTINATION_PATH | |
# rsync options explanation: | |
# -v, --verbose increase verbosity | |
# -a, --archive archive mode; same as -rlptgoD (no -H) | |
# --no-OPTION turn off an implied OPTION (e.g. --no-D) |
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
root@f827ea48f84f:/code# ffmpeg -h full | |
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers | |
built with gcc 7 (Ubuntu 7.3.0-16ubuntu2) | |
configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --e |
NewerOlder