Skip to content

Instantly share code, notes, and snippets.

@haakov
haakov / CMakeLists.txt
Created Mar 3, 2018
CMake file to compile GNU Radio display_qt C++ example standalone
View CMakeLists.txt
find_package(Qt5Widgets REQUIRED)
include_directories(
${GR_QTGUI_INCLUDE_DIRS}
${GR_ANALOG_INCLUDE_DIRS}
${GR_FILTER_INCLUDE_DIRS}
${GR_BLOCKS_INCLUDE_DIRS}
${GR_FFT_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${QT_INCLUDE_DIRS}
@nepsilon
nepsilon / how-to-output-a-range-of-lines-from-a-file.md
Created Jul 12, 2017
How to output a range of lines from a file? — First published in fullweb.io issue #107
View how-to-output-a-range-of-lines-from-a-file.md

How to output a range of lines from a file?

Easy enough with sed:

sed -n	123,230p filename

This will output filename content, from line 123 to line 230, inclusives. Notice the p letter after the last line number, this is what instruct sed to print to stdout.

View typing.py
import time
from telethon import InteractiveTelegramClient
from telethon.tl.types.input_peer_chat import InputPeerChat
from telethon.tl.functions.messages.set_typing import SetTypingRequest
from telethon.tl.types.send_message_typing_action import SendMessageTypingAction
client = InteractiveTelegramClient('session_name','+8613400000000',api_id=123456,api_hash='752f79bb39d8004006f00f761dab7f00')
peer = InputPeerChat(14884418)
act = SendMessageTypingAction()
View quick-sort.elv
fn quick-sort [li]{
if <= (count $li) 1; then
put $@li
else
quick-sort [(each { if <= $0 $li[0]; then put $0; fi } $li[1:])]
put $li[0]
quick-sort [(each { if > $0 $li[0]; then put $0; fi} $li[1:])]
fi
}
@alick
alick / isatap
Created Apr 14, 2016
Bring up IPv6 through ISATAP tunnel.
View isatap
#!/bin/bash
# vim730: set tw=80 cc=+1:
# Bring up IPv6 through ISATAP tunnel.
version="1.0"
usage() {
cat <<EOF
USAGE:
@acgotaku
acgotaku / baidupan
Last active Mar 25, 2021
新版百度云盘aria2c导出下载 ,目前只实现了核心功能.
View baidupan
// ==UserScript==
// @name 百度网盘aria2导出工具
// @author acgotaku311
// @description 一个方便吧百度网盘的Aria2rpc导出的脚本。
// @encoding utf-8
// @include http://*n.baidu.com/s/*
// @include http://*n.baidu.com/disk/home*
// @include http://*n.baidu.com/share/link*
// @include https://*n.baidu.com/s/*
// @include https://*n.baidu.com/disk/home*
@xguse
xguse / noise.sh
Last active Mar 19, 2019 — forked from rsvp/noise.sh
View noise.sh
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)