Skip to content

Instantly share code, notes, and snippets.

View YarekTyshchenko's full-sized avatar

Yarek T YarekTyshchenko

View GitHub Profile
@triangletodd
triangletodd / update_discord.sh
Created December 5, 2020 04:29
Update Discord on Debian
#!/usr/bin/env bash
set -e
trap "{ rm -f $tmpfile; }" EXIT
tmpfile="$(mktemp)"
main() {
curl -Lo "$tmpfile" 'https://discord.com/api/download?platform=linux'
sudo dpkg -i "$tmpfile"
@jumper047
jumper047 / qutemacs.py
Created November 15, 2018 21:28
Qutebrowser config with emacs key bindings
# qutemacs - a simple, preconfigured Emacs binding set for qutebrowser
#
# The aim of this binding set is not to provide bindings for absolutely
# everything, but to provide a stable launching point for people to make their
# own bindings.
#
# Installation:
#
# 1. Copy this file or add this repo as a submodule to your dotfiles.
# 2. Add this line to your config.py, and point the path to this file:
@rumpelsepp
rumpelsepp / fcd.fish
Created March 20, 2016 10:23
Fuzzy cd for fish shell using fzf
function -d "Fuzzy change directory" fcd
if set -q argv[1]
set searchdir $argv[1]
else
set searchdir $HOME
end
# https://github.com/fish-shell/fish-shell/issues/1362
set -l tmpfile (mktemp)
find $searchdir \( ! -regex '.*/\..*' \) ! -name __pycache__ -type d | fzf > $tmpfile
@siers
siers / nap.rb
Last active April 30, 2017 06:04
a more natural alarm clock command line interface
#!/usr/bin/env ruby
require 'time'
def die(str)
$stderr.puts str
exit
end
def usage
package dontfearthereaper
import "syscall"
// PR_SET_CHILD_SUBREAPER
const prSetSubreaper = 0x36
func init() {
if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, prSetSubreaper, 0, 0); err != 0 {
panic(err)
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@junegunn
junegunn / gist:f4fca918e937e6bf5bad
Last active May 4, 2024 05:07
Browsing git commit history with fzf
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fshow() {
local out shas sha q k
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --multi --no-sort --reverse --query="$q" \
--print-query --expect=ctrl-d --toggle-sort=\`); do
q=$(head -1 <<< "$out")
k=$(head -2 <<< "$out" | tail -1)
<?php
$sharedParams = ["StreamName" => "some name", "ShardId" => "some id", "ShardIteratorType" => ShardIteratorType::LATEST];
$iterator = $client->getShardIterator( $sharedParams )->get("ShardIterator");
while( 1 ){
$recordResult = $client->getRecords( ["ShardIterator" => $iterator] );
$iterator = $recordResult->get("NextShardIterator");
$records = $recordResult->get("Records");
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@MikePearce
MikePearce / post-receive
Created November 1, 2012 01:11
Basic post-receive hook
#!/usr/local/bin/php
<?php
$staging_directory = '/var/www/engni_test/';
$webroot_directory = '/var/www/engni_test_live/';
echo "****************************************************\n";
echo "*** BEGIN POST-RECEIVE\n";
echo "****************************************************\n";
echo "*** 1. checkout test\n";