Skip to content

Instantly share code, notes, and snippets.

@tigranbs
tigranbs / Ptyhon-Thumbnail-Bytes.md
Created July 9, 2019 10:25
Basic example of downloading remote image and making thumbnail with a fixed size
from PIL import Image
import requests
from io import BytesIO

url = "https://i.imgur.com/R3tZo.jpg"

def thumbnailBytes(imgURL):
  response = requests.get(url)
 img = Image.open(BytesIO(response.content))
@tigranbs
tigranbs / TwitterBot-RejectSerj.py
Created April 22, 2018 12:55
Simple Twitter Bot for Retweeting #RejectSerj Armenian protest tweets
#!/usr/bin/python3.5
import tweepy
from time import sleep
consumer_key = "<KEY HERE>"
consumer_secret = "<KEY HERE>"
access_token = "<KEY HERE>"
access_token_secret = "<KEY HERE>"
@tigranbs
tigranbs / nth_prime_number.js
Created May 2, 2017 19:09
Just a simple implementation of nth prime number in JS
function nthPrime(n) {
var P = 0;
function isPrime(x) {
var isPrime= true;
for (var d = 2; d <= Math.sqrt(x); d++) {
if((x/d) % 1 == 0) {
isPrime = false;
break;
@tigranbs
tigranbs / hello_world_with_top_15_languages.md
Last active March 12, 2017 14:02
"Hello World in Top 15 Programming Languages"

1. JavaScript

console.log("Hello World!");

2. Java

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
/platform/plugins/Q/web/js/fn/clickfocus.js
Clickfocus description
/platform/plugins/Q/web/js/fn/hautoscroll.js
Hautoscroll description
Plugin for Animated moving Element content inside it from let to right ?
/platform/plugins/Q/web/js/fn/sortable.js
lift description ?
parameters object for vertical movement