Skip to content

Instantly share code, notes, and snippets.

Выкачиваем pngquant, jpeg-archive и ставим ladon
git clone git://github.com/pornel/pngquant.git
git clone git://github.com/danielgtaylor/jpeg-archive
npm install -g ladon
Ставим зависимости для сборки (возможно есть ещё)
apt-get install nasm mozjpeg
Собираем и ставим в систему(выполнять в папках jpeg-archive и pngquant)
@thevar1able
thevar1able / gost28147-89.cpp
Created January 15, 2016 12:32
simple gost28147-89 implementation
#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <bitset>
using namespace std;
std::vector<char> readFile(char* filename) {
@thevar1able
thevar1able / md5.cpp
Created January 15, 2016 12:29
simple md5 implementation
#include <iostream>
#include <stdint.h>
#include <bitset>
#include <cmath>
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#include <functional> // 1.1.7.28
#include <algorithm>
#include <iostream>
#include <utility>
#include <string>
#include <vector>
#include <cmath>
typedef struct {
int ground, has_motor, four_wheel, electric;
#include <functional> // 1.1.7.28
#include <algorithm>
#include <iostream>
#include <utility>
#include <string>
#include <vector>
#include <cmath>
typedef struct {
int wheels, passengers, size, power;
#include <functional>
#include <algorithm>
#include <iostream>
#include <utility>
#include <float.h>
#include <string>
#include <vector>
#include <cmath>
typedef struct {
class expression
{
private:
static double OREXPR(std::vector<std::string> exp) {
std::vector<std::string>::iterator op;
if ((op = std::find(exp.begin(), exp.end(), "or")) != exp.end()) {
double first = ANDEXPR(std::vector <std::string>(exp.begin(), op));
double second = OREXPR(std::vector <std::string>(op + 1, exp.end()));
return first || second;
}
token tryFloat(std::string str)
{
token result("INVALID", "");
int state = 0;
for(auto x : str)
{
switch(state)
{
case 0:
token tryInt(std::string str)
{
token result("INVALID", "");
int state = 0;
for(auto x : str)
{
switch(state)
{
case 0:
#!/usr/bin/python
from gi.repository import GObject
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import datetime
import time
import pylast
class TinyScrobbler():