Skip to content

Instantly share code, notes, and snippets.

@gp42
gp42 / main.py
Last active May 30, 2023 14:27
List all repositories in a GitHub Organization
# List all repositories in GitHub Organization
#
# GIT_ORG - Organization name
# GIT_TOKEN - GitHub access token
#
import os
# pip install pygithub
from github import Github
@gp42
gp42 / spotify.rb
Created October 15, 2019 04:29
Get Spotify info to tmux
#!/usr/bin/env ruby
# Return a short string with spotify status
require 'json'
sym = {
:play => '►',
:pause => '■'
}
@gp42
gp42 / CmdletBinding.ps1
Last active July 9, 2018 11:54
CmdletBinding - makes a function work like a compiled cmdlet.
# The CmdletBinding attribute is an attribute of functions that makes them operate
# like compiled cmdlets that are written in C#, and it provides access to features of cmdlets.
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_cmdletbindingattribute?view=powershell-6
[CmdletBinding()]
param(
# Input params
[string]${inputParam},
# Example with validator and help message
@gp42
gp42 / rbenv-install-system-wide.sh
Created February 4, 2018 14:11 — forked from jnx/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path: