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
var SpotifyWebApi = require('spotify-web-api-node'); | |
var YandexMusicApi = require('yandex-music-api'); | |
var yandexApi = new YandexMusicApi(); | |
var spotifyApi = new SpotifyWebApi({ | |
clientId: "CLIENTID", | |
clientSecret: "CLIENTSECRET" | |
}); | |
var getMatchingSong = function(track) { | |
var options = { type: "track" }; | |
var title = track.track.artists[0].name + ' ' + track.track.name; |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"github.com/google/go-github/github" | |
) | |
func main() { |
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
if answer["response_code"] == 1 : # if we got a regular result | |
pos = answer["positives"] # number of checks that consider this part as a virus | |
tot = answer["total"] # total number of checks | |
if answer["positives"] >1 : # if there is any positive | |
result = True # set the result to malware | |
resultStringLong += "# "+ filename+":"+ str(pos) + "/" + str(tot) + " " # result 'en detail' | |
else : | |
resultStringLong += "# clean:"+filename+" " # no result, most likely that means: not a virus |
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
if answer["response_code"] == 1 : # if we got a regular result | |
pos = answer["positives"] # number of checks that consider this part as a virus | |
tot = answer["total"] # total number of checks | |
if answer["positives"] >1 : # if there is any positive | |
result = True # set the result to malware | |
resultStringLong += "# "+ filename+":"+ str(pos) + "/" + str(tot) + " " # result 'en detail' | |
else : | |
resultStringLong += "# clean:"+filename+" " # no result, most likely that means: not a virus |
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
import sys | |
from PIL import Image | |
filename = sys.argv[1] | |
my_new_image = Image.new('RGB', (510, 311), (255,255,255,0)) | |
old_image = Image.open(filename) | |
old_size = old_image.size | |
aspect = old_size[0] / float(old_size[1]) | |
new_width = int(aspect*311) | |
paste = (510 - new_width)/2 |
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
from arequests.api import * |
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
import time | |
from twisted.internet import defer | |
from twisted.internet import reactor | |
import txredisapi as redis | |
HOST = 'localhost' | |
PORT = 6379 | |
N = 1000 |
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
# encoding: utf-8 | |
from __future__ import print_function | |
import docker | |
import unittest | |
from fabric.api import env, run, execute | |
class DockerTest(unittest.TestCase): | |
def setUp(self): | |
self.client = docker.Client(**self.get_client_spec()) |
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
-module(facebook). | |
-export([square/1, print_square/1]). | |
square(N)->square(1, N). | |
square(Start, 1)->[[Start]]; | |
square(Start, 2)->[[Start, Start+1], [Start+3, Start+2]]; | |
square(Start, N)-> | |
TopRight = Start+N-1, | |
[lists:seq(Start, TopRight)]++ | |
extend(square(TopRight+3*N-3, N-2), TopRight+3*N-4, TopRight+1, [])++ |
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
#!/usr/bin/env python3 | |
from datetime import timedelta | |
import time | |
import json | |
import logging | |
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import tornado.ioloop |
NewerOlder