Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
// sample of using POCO's Thread | |
#include "Poco/Runnable.h" | |
#include "Poco/Thread.h" | |
#include <iostream> | |
using namespace std; | |
class Worker:public Poco::Runnable{ | |
public: |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Located in alphabetical order (not prefer)
C
ab
), also designed as a more modern replacement, written in C
golang
)# -*- coding: utf-8 -*- | |
# Портирован с Java по мотивам http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html | |
import re | |
class Porter: | |
PERFECTIVEGROUND = re.compile(u"((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$") | |
REFLEXIVE = re.compile(u"(с[яь])$") | |
ADJECTIVE = re.compile(u"(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$") | |
PARTICIPLE = re.compile(u"((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$") | |
VERB = re.compile(u"((ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)|((?<=[ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)))$") |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars
file, reference that vars
file from your task
, and encrypt the whole vars
file using ansible-vault encrypt
.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
template<class Import, class StringType = boost::string_ref> | |
struct JsonVisitor | |
{ | |
JsonVisitor(Import& import,const boost::dynamic_bitset& filterresult):import(import),key(key),filterresult(filterresult){} | |
template<class Value> | |
bool operator()(const Value& v)const | |
{ | |
import.processKeyValue(current_key,v); | |
return true; | |
} |
#include <glm/gtx/string_cast.hpp> | |
.. | |
.. | |
glm::mat4 mat; | |
.. | |
.. | |
std::cout << glm::to_string(mat) << std::endl; |
/* | |
== Adapted from the code over at https://gist.github.com/graymouser/a33fbb75f94f08af7e36 == | |
Log into your account at packtpub.com and save the cookies with the "cookies.txt" Chrome extension or the "Export cookies" Firefox extension into the file cookies.txt. | |
Then open the console in your browsers dev tools and paste the following code. | |
You will get a list of wget commands that you can copy and paste as a whole into a terminal to download all books. | |
Example: wget --load-cookies=cookies.txt --content-disposition "https://packtpub.com//ebook_download/20217/mobi" -O "R Data Visualization Cookbook.mobi" | |
If you only want some filetypes, edit the "pattern" vaiable accordingly. |
This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.
This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.