Skip to content

Instantly share code, notes, and snippets.

View hamidzr's full-sized avatar
🎯
[~/] # ...

Hamid Zare hamidzr

🎯
[~/] # ...
View GitHub Profile
[SwitchyOmega Conditions]
; Require: SwitchyOmega >= 2.3.2
; Date: 12/21/2016
; Usage: https://github.com/FelisCatus/SwitchyOmega/wiki/RuleListUsage
*.digitaltrends.com
*.krxd.net
*.pinterest.com
*.costco.com
*.att.com
@hamidzr
hamidzr / rev-youtube-playlist-urls.sh
Created April 23, 2017 14:07 — forked from amberj/rev-youtube-playlist-urls.sh
This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order
#!/bin/bash
#
# File: rev-youtube-playlist-urls.sh
# Description: This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order (i.e. starting from last video in playlist)
# Author: Amber Jain
# Check if "only one" argument (playlist_url) passed as input:
if [ "$#" -lt "1" ]
then
echo "Invalid! You must pass playlist_url as argument"
@hamidzr
hamidzr / playYoutube.sh
Last active July 19, 2022 19:33
Play youtube videos from commandline to kodi / xbmc.
#!/bin/bash
REGEX="^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*"
ID=$1
if [ "$ID" == "" ];
then
echo "Syntax $0 <id|url>"
exit
fi
@hamidzr
hamidzr / playOnKodi.sh
Created April 24, 2017 16:01
play generic uri to kodi instance.
#!/bin/bash
# pass a uri as an argument to play
curl -s --data-ascii '{"jsonrpc":"2.0","id":"1","method":"Application.SetVolume","params":{"volume":70}}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
curl -s --data-ascii '{"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"'$1'"}}}' -H 'content-type: application/json;' http://hpi:8080/jsonrpc
@hamidzr
hamidzr / cs2201-combineReadmes.sh
Last active April 24, 2017 18:10
a helper to combine readme files for cs2201 (Vanderbilt)
#!/bin/bash
# rename each student's readmefile to his/her score and save to a single directory
# depends on these tools: bash, file, grep, unzip, sed
#relative output file address
output='readmes.txt'
echo '' > $output
for filename in *.*; do
@hamidzr
hamidzr / playATed.py
Last active April 25, 2017 16:02
surprise me with a random ted talk interesting to me.
#!/usr/bin/python3
#python3
import urllib.request
from urllib.parse import quote
import json
# configs
YOUTUBE_API='update me'
KODI_ADDRESS = 'http://localhost:8080'
@hamidzr
hamidzr / playYtSearch.py
Last active May 1, 2017 02:48
searches youtube with your search query and starts playing the first 50 results
#!/usr/bin/python3
#python3
import urllib.request
from urllib.parse import quote
import json
import sys
# configs
YOUTUBE_API='update me'
@hamidzr
hamidzr / archSetup.sh
Last active December 15, 2019 03:24
basic arch setup script. download it with `wget tinyurl.com/simplearchsetup`
#!/bin/bash
# description: basic arch setup script, pass in the a part eg: ./archSetup.sh p1
# assumptions:
# UEFI + GPT
# partitions: esp root swap (no lvm)
# alert: dont format esp partition if dual booting the system
# argument: #1: p1 or p2
# init
@hamidzr
hamidzr / playYtTrendingMusic.py
Last active May 21, 2017 22:34
Play trending youtube videos from a specific playlist randomly. The default playlist is trendin music of the week.
#!/usr/bin/python3
#python3
import urllib.request
from urllib.parse import quote
import json
import sys
# configs
YOUTUBE_API='updateme'
@hamidzr
hamidzr / githubPlus.js
Last active November 14, 2017 17:42
github improvments. userscripts link: https://greasyfork.org/en/users/135513-hamidzr
// ==UserScript==
// @name GitHub PullRequests Plus
// @namespace http://tampermonkey.net/
// @version 0.3.0
// @updateURL https://gist.githubusercontent.com/hamidzr/3167e68addb1bf69eef425348ae35c90/raw
// @description Displays a bunch of usefull information next to the github pullrequests such as diff stats and latest comments
// @author Hamid Zare @hamidzr
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.25.0/babel.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.2/axios.min.js