Skip to content

Instantly share code, notes, and snippets.

View ratheesh's full-sized avatar

Ratheesh ratheesh

  • Bangalore, KA, IN
  • 08:17 (UTC +05:30)
View GitHub Profile
@rutles
rutles / gpio_poll.c
Last active January 4, 2023 09:39
Raspberry Pi GPIO polling by wait for event example. Most simple code. No count errors.
/*
gpio_poll.c
Raspberry Pi GPIO polling example.
Hardware: A switch (hardware pulluped) shall be connected to GPIO25.
Compile: cc gpio_poll.c -o gpio_poll
Execute: sudo ./gpio_poll.c
*/
#include <fcntl.h>
#include <stdio.h>
@blueyed
blueyed / _tmux_pane_words.zsh
Last active April 27, 2026 06:43
ZSH configuration to complete words from tmux pane(s)
# Complete words from tmux pane(s) {{{1
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html
# Gist: https://gist.github.com/blueyed/6856354
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1
fi
@Gnurou
Gnurou / Kexec for ARM
Created October 28, 2013 03:34
Cross-compiling Kexec for ARM, how-to.
./bootstrap
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi --without-zlib --without-lzma
make
-> static binary in build/sbin/kexec
@rainerborene
rainerborene / ctrlp.vim
Last active November 22, 2017 13:52
Close buffer via <C-@> using CtrlP
let g:ctrlp_buffer_func = { 'enter': 'CtrlPMappings' }
function! CtrlPMappings()
nnoremap <buffer> <silent> <C-@> :call <sid>DeleteBuffer()<cr>
endfunction
function! s:DeleteBuffer()
let path = fnamemodify(getline('.')[2:], ':p')
let bufn = matchstr(path, '\v\d+\ze\*No Name')
exec "bd" bufn ==# "" ? path : bufn
@shivam5992
shivam5992 / rest_app.py
Created January 16, 2014 08:45
REST ful web API using Flask A simple To-Do list implementation
'''
REST Ful WEB API in Flask
Simple Rest api in which resource is list of tasks
methods are implemented for GET, POST, PUT, DELETE
author: Shivam Bansal
website: shivambansal.com
Reference: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
'''
@reagent
reagent / .gitignore
Last active November 8, 2023 08:53
Curses Windowing Example
demo
*.swp
@dsager
dsager / create_repo.sh
Last active April 25, 2017 13:31
Shell Script to Merge Multiple Git Repositories via Subtree Merge
#! /bin/sh
# based on https://help.github.com/articles/working-with-subtree-merge
# Copyright (c) 2014 Daniel Sager
# License: MIT, https://gist.github.com/dsager/0edcbf806b5b86e78455#file-2014
REPOS="front-end back-end"
BRANCHES="develop master"
DIR="monolith"
@ctechols
ctechols / compinit.zsh
Last active April 16, 2026 22:00
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@ruario
ruario / intro-latest-widevine.md
Last active November 14, 2025 15:42
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.

With the release of Vivaldi 2.2, this page is now obsolete and unmaintained. Widevine is fetched automatically on post install of our official packages. The information below and the script are left for historical reasons but will not be updated.

If you are using something newer than Vivaldi 2.2, you should not be using this script as there is simply no need. Any need you think you have for it would be a bug IMHO and thus should be logged in a bug report. Before you do so however, you should also checkout the Vivaldi help page on Widevine, on Linux


Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a b

@HerringtonDarkholme
HerringtonDarkholme / ctrlp.vim
Last active July 6, 2019 17:48
give syntax highlight for ctrlp vim-devicon
"I borrowed this crazy code from vim-tomorrow-theme colorschemes
" Returns an approximate grey index for the given grey level
fun! s:grey_number(x)
if &t_Co == 88
if a:x < 23
return 0
elseif a:x < 69
return 1
elseif a:x < 103