Skip to content

Instantly share code, notes, and snippets.

View artemdevel's full-sized avatar
😎
Coding

Artem artemdevel

😎
Coding
View GitHub Profile
@artemdevel
artemdevel / test5.py
Created February 20, 2013 16:10
SignalManager tests
from scrapy import signals
from scrapy.http import Request
from scrapy.spider import BaseSpider
from scrapy.signalmanager import SignalManager
class Test5(BaseSpider):
""" New SignalManager API test, doesn't work
"""
name = "test5"
start_urls = ["http://httpbin.org/status/200"]
@artemdevel
artemdevel / get_product.py
Last active April 29, 2016 10:30
Get product
#!/usr/bin/env python
""" Get Amazon product by ID via Amazon API
"""
import sys
import hmac
import hashlib
import urllib
import urlparse
import argparse
from datetime import datetime
@artemdevel
artemdevel / swagger_tools.md
Last active August 29, 2015 14:27
Swagger tools

Install Swagger Editor, Swagger UI and Swagger validation badge locally in Docker containers.

  1. Clone all the repos

git clone https://github.com/swagger-api/swagger-editor.git
git clone https://github.com/swagger-api/swagger-ui.git
git clone https://github.com/swagger-api/validator-badge.git
@artemdevel
artemdevel / brackated_paste_mode.md
Last active August 29, 2015 14:27
Brackated paste mode

This little nice feature is bugging me a lot in all Ubuntu 14.04 I use.. bracketed paste mode.

printf "\e[?2004l"

@artemdevel
artemdevel / main.go
Created March 26, 2016 21:41
Simple golang "OOP" example
/* Output
{{} Something 1} true
Something 1 <nil>
Not implemented
Doing something
Something 1 <nil>
Not implemented
Not implemented
*/
package main
@artemdevel
artemdevel / gist:9edfcb387531ecbf6ba770946235519d
Last active April 24, 2017 10:22
Android 6.0.1 (Build M4B30X) Root for Nexus 5
# Download latest Android image, "hammerhead" for Nexus 5 (GSM/LTE)
https://developers.google.com/android/nexus/images#hammerhead
# Download latest TWRP
https://dl.twrp.me/hammerhead/
# Download latest SuperSu
https://download.chainfire.eu/supersu
Enable USB debugging.
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O ~/mailhog https://github.com/mailhog/MailHog/releases/download/v0.2.1/MailHog_linux_amd64
# Make it executable
chmod +x ~/mailhog
@artemdevel
artemdevel / Dockerfile
Last active October 19, 2017 04:54
Java REPL Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAVA_REPL_VERSION=VERSION_NOT_SET
WORKDIR javarepl
ADD https://github.com/albertlatacz/java-repl/releases/download/$JAVA_REPL_VERSION/javarepl-$JAVA_REPL_VERSION.jar javarepl/javarepl.jar
CMD ["java", "-jar", "javarepl/javarepl.jar"]
@artemdevel
artemdevel / script.sh
Last active October 5, 2023 13:32
Build Cpp Core Guidelines PDF
#!/usr/bin/env bash
# NOTE: I haven't tested this script myself. At least I know that command line parameters for Pandoc has changed.
# https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
wget -N https://raw.githubusercontent.com/isocpp/CppCoreGuidelines/master/CppCoreGuidelines.md
wget -N https://raw.githubusercontent.com/isocpp/CppCoreGuidelines/master/param-passing-advanced.png
wget -N https://raw.githubusercontent.com/isocpp/CppCoreGuidelines/master/param-passing-normal.png
# https://github.com/isocpp/CppCoreGuidelines/issues/23
#!/usr/bin/env python
"""
Simple WebSocket client.
"""
import sys
import asyncio
import websockets
# The official echo server