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
[Desktop Entry] | |
Name=Evolution (Legacy TLS) | |
GenericName=Groupware Suite | |
X-GNOME-FullName=Evolution | |
Comment=Manage your email, contacts and schedule | |
Keywords=email;calendar;contact;addressbook;task; | |
Actions=new-window;compose;contacts;calendar;mail;memos;tasks; | |
Exec=env G_TLS_GNUTLS_PRIORITY=NORMAL:+VERS-TLS1.0 evolution %U | |
Icon=evolution | |
Terminal=false |
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 sly import Lexer, Parser | |
import pprint | |
class JSONLexer(Lexer): | |
tokens = {"FLOAT", "INTEGER", "STRING"} | |
literals = {'{', '}', '[', ']', ',', ':'} | |
ignore = " \t\n" |
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
class OrderedDequeDict(OrderedDict): | |
def __init__(self, size=100, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.size = size | |
def __setitem__(self, key, value): | |
if key in self: | |
del self[key] | |
elif len(self) == self.size: |
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
/* Map Name: settlers.xs | |
*/ | |
//Include the library file. | |
include "MmM_FE_lib.xs"; | |
// Main entry point for random map script | |
void main(void){ | |
/* **************************** */ |
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
find . -name '*.csv' -exec cp --parents \{\} /target \; |
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 lxml import etree | |
from urllib import request | |
page = request.urlopen("http://link.fr").read() | |
root = etree.HTML(page) | |
items = root.xpath("//div[@class='custom-class']/text()") |
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 asyncio | |
import json | |
from os import path | |
import aiohttp | |
import async_timeout | |
imdb_ids = ['0114319', '0112302', '0114576', '0113189', '0112346', '0112896', '0112453', | |
'0113987', '0112760', '0112641', '0114388', '0113101', '0112281', '0113845'] | |
api_url = "http://www.omdbapi.com/?i=tt%s&plot=full&r=json" |
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 numpy as np | |
from subprocess import PIPE, run | |
from scipy.io.wavfile import read, write | |
## This is in case you have a numpy nd array of your sound, and the sampling rate | |
## isn't the same as another ndarray. This resamples the array by piping in and out of Sox | |
## This is a simple example with wav files encoded in float32, with only one channel (mono) | |
## These parameters can however be adjusted by tweaking -t and -c options in the sox command | |
with open("sample_48k.wav", "rb") as file_48k, open("sample_16k.wav", "rb") as file_16k: |
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 scipy.io.wavfile import read, write | |
import io | |
## This may look a bit intricate/useless, considering the fact that scipy's read() and write() function already return a | |
## numpy ndarray, but the BytesIO "hack" may be useful in case you get the wav not through a file, but trough some websocket or | |
## HTTP Post request. This should obviously work with any other sound format, as long as you have the proper decoding function | |
with open("input_wav.wav", "rb") as wavfile: | |
input_wav = wavfile.read() |