Skip to content

Instantly share code, notes, and snippets.

View vladimirmyshkovski's full-sized avatar
🎯
Focusing

Vladimir Myshkovski vladimirmyshkovski

🎯
Focusing
View GitHub Profile
@vladimirmyshkovski
vladimirmyshkovski / docker-destroy-all.sh
Created July 18, 2017 05:27 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
(function(window, document, version, callback) {
var j, d;
var loaded = false;
if (!(j = window.jQuery) || version > j.fn.jquery || callback(j, loaded)) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "/media/jquery.js";
script.onload = script.onreadystatechange = function() {
if (!loaded && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
callback((j = window.jQuery).noConflict(1), loaded = true);
@vladimirmyshkovski
vladimirmyshkovski / README-Template.md
Created August 18, 2017 14:11 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@vladimirmyshkovski
vladimirmyshkovski / get-social-shares
Created September 21, 2017 19:13 — forked from ihorvorotnov/get-social-shares
Get number of shares from social platforms
Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
import functools
from channels.handler import AsgiRequest
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.settings import api_settings
authenticators = [auth() for auth in api_settings.DEFAULT_AUTHENTICATION_CLASSES]
import functools
from channels.handler import AsgiRequest
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.settings import api_settings
authenticators = [auth() for auth in api_settings.DEFAULT_AUTHENTICATION_CLASSES]
@vladimirmyshkovski
vladimirmyshkovski / gist:672e0ed407d2b85292a56d55c25af0b8
Created November 23, 2017 12:00 — forked from alexanderjulo/languages-and-countries.py
Python Tuple Lists with language codes (as of ISO 639-1) and country codes (as of ISO 3166)
languages = [
('aa', 'Afar'),
('ab', 'Abkhazian'),
('af', 'Afrikaans'),
('ak', 'Akan'),
('sq', 'Albanian'),
('am', 'Amharic'),
('ar', 'Arabic'),
('an', 'Aragonese'),
('hy', 'Armenian'),
@vladimirmyshkovski
vladimirmyshkovski / django-image-save.py
Created December 1, 2017 13:06 — forked from iambibhas/django-image-save.py
Programatically save ImageField in Django
import requests
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
def save_image_from_url(model, url):
r = requests.get(url)
img_temp = NamedTemporaryFile(delete=True)