- Get your store id at https://lenta.com/api/v1/stores/
- Grab promoted goods info at:
https://lenta.com/api/v1/stores/<store_id>/home https://lenta.com/api/v1/stores/<store_id>/crazypromotions https://lenta.com/api/v1/stores/<store_id>/mobilepromo?hideAlcohol=false&limit=15&offset=0&type=weekly
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
use std::time::Duration; | |
use std::{env, io, fs, fmt}; | |
use sdl2::Sdl; | |
use sdl2::pixels::Color; | |
use sdl2::render::Canvas; | |
struct Instruction { | |
bytes: [u8; 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
#!/usr/bin/env python3 | |
import sys | |
def check_args(): | |
if len(sys.argv) != 2: | |
print("Usage: python3 assembler.py <file.asm>") | |
sys.exit(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
~ ❱ cat .bin/open-iterm2 | |
#!/usr/bin/env bash | |
# Detects if iTerm2 is running | |
if ! pgrep -f "iTerm" > /dev/null; then | |
open -a "/Applications/iTerm.app" | |
else | |
# Create a new window | |
if ! osascript -e 'tell application "iTerm2" to create window with default profile' > /dev/null; then | |
# Get pids for any app with "iTerm" and kill |
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 os | |
import sqlite3 | |
import requests | |
from collections import defaultdict | |
def create_schema(): | |
conn = sqlite3.connect('db.sqlite') | |
c = conn.cursor() | |
c.execute('''CREATE TABLE posts |
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
""" | |
1. Create a list of first names | |
2. Create a list of last names | |
3. Combine them randomly into a list of 100 full names | |
4. Insert into sqlite table "Names" | |
""" | |
import sqlite3 | |
import random |
on Pi:
ffmpeg -f v4l2 -input_format mjpeg -video_size 1280x720 -framerate 60 -i /dev/video0 -c:v h264_omx -framerate 60 -b:v 1k -flags:v +global_header -bsf:v dump_extra -f rawvideo udp://phi:25000
on client:
vlc --demux h264 udp://@:25000
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 hw06_pipeline_execution //nolint:golint,stylecheck | |
type ( | |
I = interface{} | |
In = <-chan I | |
Out = In | |
Bi = chan I | |
) | |
type Stage func(in In) (out Out) |
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 | |
import time | |
import logging | |
from pydbus import SystemBus, SessionBus | |
from gi.repository import GLib | |
logging.basicConfig(level=logging.DEBUG) | |
logger = logging.getLogger(__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
#include <stdio.h> | |
#include <string.h> | |
#define OPEN_BRACKETS 5 | |
#define STR_LENGTH 10 | |
void gen(int length, int opened, int closed, char* str) { | |
if (opened + closed == 2 * length) { | |
printf("%s\n", str); | |
return; |
NewerOlder