Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
#!/bin/bash
#
# Author: Jacer Omri
# Description:
# text to speech engine using google
## a function to encode urls
rawurlencode() {
local string="${1}"
local strlen=${#string}
@aras-p
aras-p / preprocessor_fun.h
Last active May 18, 2024 08:55
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@sloria
sloria / bobp-python.md
Last active May 12, 2024 06:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@cirrusUK
cirrusUK / pms.py
Created December 4, 2013 19:49
standalone python script for searching,streaming,downloading mp3's from www.pleer.com script author https://github.com/np1/pms #python script 'poor mans spotify'
#!/usr/bin/python
''' pms
Copyright (C) 2013 nagev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@seveas
seveas / hpilo.py
Last active October 12, 2019 10:56
# (c) 2011-2013 Dennis Kaarsemaker <dennis@kaarsemaker.net>
# see COPYING for license details
# Test edit!
import os
import platform
import random
import re
import socket
import subprocess
@rdb
rdb / js_winmm.py
Last active February 17, 2024 10:04
Access game controllers from Python on Windows via the WinMM API. See https://discourse.panda3d.org/t/game-controllers-on-windows-without-pygame/14129
# Released by rdb under the Unlicense (unlicense.org)
# Further reading about the WinMM Joystick API:
# http://msdn.microsoft.com/en-us/library/windows/desktop/dd757116(v=vs.85).aspx
from math import floor, ceil
import time
import ctypes
import _winreg as winreg
from ctypes.wintypes import WORD, UINT, DWORD
from ctypes.wintypes import WCHAR as TCHAR
if [ $EUID != 0 ]; then
echo "It's a weird tree."
else
echo ' _ __'
echo ' / `\ (~._ ./ )'
echo ' \__/ __`-_\__/ ./'
echo ' _ \ \/ \ \ |_ __'
echo ' ( ) \__/ -^ \ / \'
echo ' \_/ " \ | o o |.. / __'
echo " \\. --' ==== / || / \\ "
@goakley
goakley / tilted.py
Created March 24, 2014 03:01
Tilts the screen based on the orientation of my laptop
#!/usr/bin/python3
from collections import deque
from time import sleep
from os import system
def tilt():
with open('/sys/devices/platform/lis3lv02d/position') as f:
return int(f.read().split(",")[1])
@ValdikSS
ValdikSS / gist:d896cebd8e1aafc65b4b
Created July 19, 2014 11:52
thermald config for x220
<?xml version="1.0"?>
<!--
use "man thermal-conf.xml" for details
-->
<!-- BEGIN -->
<ThermalConfiguration>
<Platform>
<Name>Lenovo ThinkPad X220</Name>
<ProductName>*</ProductName>
<Preference>QUIET</Preference>