Skip to content

Instantly share code, notes, and snippets.

@trollknurr
trollknurr / song.sh
Created August 21, 2019 13:02
Mac google play music app current song
#!/usr/local/bin/bash
cat /Users/ashtarev/Library/Application\ Support/Google\ Play\ Music\ Desktop\ Player/json_store/playback.json | /usr/local/bin/jq '.song.artist + " - " + .song.title' | tr '"' ' '
@trollknurr
trollknurr / ex.py
Created June 8, 2018 12:22
bar with annotation
ax = plt.gca()
pd.concat([x_rdf[ cf + ['total'] ], activity_rate_abs, tm_res_df_abs.rename('tmdb_votes')], axis=1).plot.bar(
ax=ax, width=0.85
)
plt.legend()
plt.xticks(x_rdf.index, range(13))
@trollknurr
trollknurr / index.js
Created June 2, 2016 09:49
Вопрос react-router
render(h(Provider, {
store: store
}, [
div([
h(Router, {
history: browserHistory
},
[h(Route, {
path: "oi/:orderID/",
name: "Операторский интерфейс",
@trollknurr
trollknurr / assert.py
Created May 6, 2016 11:31
Assert list in list of lists and has equal content
def assertListInList(self, member, container):
for item in container:
try:
self.assertCountEqual(item, member)
except AssertionError:
continue
break
else:
raise AssertionError('No match found')
@trollknurr
trollknurr / vpnc-split-script
Last active February 19, 2024 14:12
openconnect vpn split routing sh script
#!/bin/sh
# Add one IP to the list of split tunnel
add_ip ()
{
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_ADDR=$1
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_MASK=255.255.255.255
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_MASKLEN=32
export CISCO_SPLIT_INC=$(($CISCO_SPLIT_INC + 1))
}