Skip to content

Instantly share code, notes, and snippets.

View aleybe's full-sized avatar

Alex aleybe

View GitHub Profile
function Get-LsGrep {
[Alias("lgrep")]
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
[System.Array]
$lsOutput,
# Parameter help description
[Parameter(Position=1)]
[System.String]
@aleybe
aleybe / function_library.py
Created December 26, 2019 06:39
Example for blog post
import random
def create_rick_and_morty_adventure(input_string: str):
""" This is a method that grabs random words from a string """
# First create a list from the input string
start_list = input_string.split()
@aleybe
aleybe / test_function_library.py
Last active December 26, 2019 06:27
tests_random_words_function_blog
import unittest
import function_library as fl
class Test_FunctionLibrary(unittest.TestCase):
"""
Test function library in here
"""
@aleybe
aleybe / uberdinner.js
Last active November 9, 2019 12:42
Randomly Choose Saturday Night Dinner
function chooseMyUberDinner() {
var listofplaces = $('.eb').children
var listofopportunities = []
for (var place in listofplaces) {
var currentplace = listofplaces[place]
if (currentplace.children === undefined) {
@aleybe
aleybe / getBeer.js
Last active June 1, 2019 18:34
node_getBeerDescriptions
function getBeerApiGET (callback) {
var request = require('request');
request('https://api.punkapi.com/v2/beers/random', function (error, response, body) {
if (!error && response.statusCode == 200) {
callback(body); // Print the google web page.
}
});
};
var getBeer = new Promise(function(resolve, reject) {
@aleybe
aleybe / savethis.py
Last active April 26, 2020 20:10
Spotify API QuickSave
import json
import urllib.request as urx
import sys
import keyboard
# rl -X PUT "https://api.spotify.com/v1/me/tracks?ids=ssadasdasd" -H "Accept: application/json"
globalauth = "Bearer TOKEN"
isquit = False
@aleybe
aleybe / newbotwhodis.py
Created March 7, 2018 11:33
rock paper scissors bot
import discord
import asyncio
import random
client = discord.Client()
@client.event
async def on_ready():
print("Ready!")