Skip to content

Instantly share code, notes, and snippets.

Stany MARCEL ynsta

Block or report user

Report or block ynsta

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ynsta
ynsta / json2vdf.py
Last active Sep 25, 2017
Steam vdf/json converters
View json2vdf.py
#!/usr/bin/env python
import json
def json2vdf(stream):
"""
Read a json file and return a string in Steam vdf format
"""
@ynsta
ynsta / blur.sh
Last active Jul 24, 2018
Blur konsole and yakuake instead of simple transparency
View blur.sh
# add to zshrc
function blur-konsoles() {
windows=($(qdbus org.kde.konsole 2>/dev/null | egrep '^\/konsole\/MainWindow_[0-9]+$'))
for win in ${windows}; do
winId=$(qdbus org.kde.konsole $win winId 2>/dev/null)
[ ! -z "${winId}" ] && xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id "${winId}"
done
qdbus org.kde.yakuake &>/dev/null && xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -name Yakuake
}
[ ! -z "$KONSOLE_DBUS_WINDOW" ] && blur-konsoles
@ynsta
ynsta / stm32f7x.cfg
Created Jun 24, 2015
OpenOCD 0.9.0 config for STM32F746G-DISCO target (stm32f746ng)
View stm32f7x.cfg
# script for stm32f7x family
#
# stm32 devices support both JTAG and SWD transports.
#
source [find target/swj-dp.tcl]
source [find mem_helper.tcl]
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
@ynsta
ynsta / sampler.py
Last active Apr 25, 2019
Statistic profiling on stm32f4 with openocd by dwt_pcsr sampling
View sampler.py
#!/usr/bin/python2
# run openocd (0.9.0) with :
# $ openocd -f stlink-v2-1.cfg -f stm32f4x.cfg &> /dev/null"
# then run
# $ python2 sampler.py path_to_myelf_with_symbols
import sys
import time
import telnetlib
@ynsta
ynsta / WellerRTProto.ino
Created Jul 1, 2014
Weller RT Station PID Protoype
View WellerRTProto.ino
#define TEMPERATURE 350
#define TEMPERATURE_MAX 400
#define PWM_PIN 3
#define PWM_MAX 245
#define PID_INT_MAX (500)
#define PID_INT_MIN (-PID_INT_MAX)
#define TEMP_GAIN 0.42
@ynsta
ynsta / git-delivery.sh
Created Jun 11, 2014
bashrc: git-delivery shell function
View git-delivery.sh
function git-delivery() {
git status >/dev/null || return 1
dtag=$(git describe --abbrev=0 --tags 2>/dev/null | git log -1 --pretty='%h')
dext='tar'
for i; do
case $i in
-h|--help)
cat <<EOF
usage: git-delivery [tag] [ext]
@ynsta
ynsta / .bashrc
Last active Aug 29, 2015
bashrc: absdir and setenv functions
View .bashrc
function absdir() {
for i; do
python -c "import os; print os.path.abspath('$i')"
done
}
function setenv() {
for env ; do
if [ -d "${env}" ]; then
env=$(absdir "$env")
@ynsta
ynsta / par2protect.py
Last active Mar 16, 2016
Protect files in each directory recursively using par2. It repairs and updates with par2, if only adler32 sum of files does not match.
View par2protect.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import zlib
import ctypes
import subprocess
DESCRIPTION = 'Protect files in directories recursively with par2.'
You can’t perform that action at this time.