Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
@mikroskeem
mikroskeem / index.php
Last active August 29, 2015 14:15
Led blinker made in Raspberry Pi cluster building @ Tartu
<html>
<meta charset="utf-8">
<body>
<h1>Led test</h1>
<button onClick="b()"><span id="lol"></span></button>
<script>
var is_running="<?php
if($_GET["run"] == "1"){
shell_exec("/home/pi/suid -c '/home/pi/vilguta.sh' >/dev/null"); echo "1";
} else if($_GET["run"] == "0"){
@mikroskeem
mikroskeem / fortune.desktop
Created March 11, 2015 12:38
Displays fortune on login
[Desktop Entry]
Type=Application
Name=Fortune notification
Comment=Fortune in notification
Exec=/home/mark/bin/fortune.py
OnlyShowIn=GNOME;
X-GNOME-Autostart-Phase=Application
@not-much-io
not-much-io / pipeline.py
Last active September 3, 2015 09:21
python pipeline
def inc(x):
return x + 1
def pipe(val, *args):
for func in args:
val = func(val)
return val
pipe(1, inc, inc, inc)
anonymous
anonymous / say.py
Created January 31, 2013 21:41
Assist in performing online Text-To-Speech and immediate playback.
#!/usr/bin/env python
"""
Assist in performing online Text-To-Speech and immediate playback.
"""
import sys
import requests
import urllib
import tempfile
import commands
#!/bin/bash
#
# Author: Mike Herwig
# Enhanced: Jacer Omri
# Description:
# Simple voice control demonstration using google's speech-api
if [ -z "$1" ]
then
echo "No language supplied, using en\n"
#!/bin/bash
#
# Author: Jacer Omri
# Description:
# text to speech engine using google
## a function to encode urls
rawurlencode() {
local string="${1}"
local strlen=${#string}
@mikroskeem
mikroskeem / vimrc.vim
Last active February 7, 2016 22:34
Tiny (neo)vim config
" ###### Many settings, wow'
" Better tab completion
set wildmode=longest,list,full
" Airline does this already
set noshowmode
" Do not use double space on some characters
set ambiwidth=single
" Remove startup screen
set shortmess+=I
@mikroskeem
mikroskeem / draw.html
Created September 30, 2016 13:01
Extremely old canvas test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JS test</title>
<style type="text/css">
* { margin:0; padding:0; }
html, body { width:100%; height:100%; }
canvas { background: #eee; }
@afogal
afogal / fix_telegram_bubbles.md
Created September 22, 2016 01:45
How to fix the really really round telegram bubbles

Here is a GDB script to fix it (tested on GNU/Linux only):

 tbreak _ZN3App9initMediaEv
 commands
     set {char}_ZN3App9msgRadiusEv=0xB8
     set {int}(_ZN3App9msgRadiusEv+1)=3
     set {char}(_ZN3App9msgRadiusEv+5)=0xC3
 end
 run

detach

@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>