Skip to content

Instantly share code, notes, and snippets.

Vitaly Larchenkov Sonique

  • Russia
Block or report user

Report or block Sonique

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Sonique /
Created Aug 10, 2018 — forked from jossef/
python different ways to import external modules (from cdn / memory string / file path / plugin directory)
import imp
import importlib
import inspect
import glob
import requests
import os
def import_from_string(content, module_name, file_name=None):
if not file_name:
file_name = '{0}.py'.format(module_name)
Sonique / hosts.ini
Created Jul 23, 2018
Ansible: use any python version for ansible_python_interpreter
View hosts.ini
ansible_python_interpreter = ls /usr/bin/ | grep -E "^python([2-3](.[0-9])?)?$" | head -n 1
Sonique /
Created Apr 24, 2017
Java Executor proper shutdown
try {
System.out.println("attempt to shutdown executor");
executor.awaitTermination(5, TimeUnit.SECONDS);
catch (InterruptedException e) {
System.err.println("tasks interrupted");
finally {
if (!executor.isTerminated()) {
View shri.js
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
function getData(url, callback) {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name :'Fiji Islands', continent: 'Oceania'},
View gist:edb54e612289edb2b83d
# Script dir for script relative path
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
Sonique / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Sonique /
Last active Aug 29, 2015
Simple Java code execution timer
// Basic
long start = System.currentTimeMillis();

long end = System.currentTimeMillis();
// Stopwatch
Stopwatch stopwatch = new Stopwatch();
double time = stopwatch.elapsedTime();
// #java #timer #stopwatch
Sonique /
Last active Aug 29, 2015
Put files from master branch to production folder
echo "================================="
echo "Post-receive script: START"
while read oldrev newrev refname
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ $branch == "master" ]; then
echo "Branch determined as master."
Sonique /
Last active Jul 23, 2018
Bash: swap files
function swap() { mv $1 $1._tmp; mv $2 $1; mv $1._tmp $2; }
Sonique / gist:7e65abcae021027beabf
Created Jun 22, 2014
Laravel .gitignore extended
View gist:7e65abcae021027beabf
# System
# Editors
You can’t perform that action at this time.