Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@JuniorJPDJ
JuniorJPDJ / yt-search-rss.gs
Last active July 15, 2023 20:38
Youtube Search RSS generator (deployable on Google Apps Script)
function getSearchRSS(query){
let results = YouTube.Search.list('id, snippet', {
q: query,
maxResults: 50,
order: 'date'
});
let encoded_query = encodeURIComponent(query)
let rss_url = ScriptApp.getService().getUrl() + "?" + encoded_query;
@TheMatt2
TheMatt2 / walklevel.py
Last active April 13, 2023 22:12
A python function to do an os.walk(), but only to a certain depth. A negative depth indicates full depth.
# MIT License
#
# Copyright (c) 2021 Matthew Schweiss
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@SabretWoW
SabretWoW / json_response_handling_ruby.rb
Created December 11, 2013 14:20
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html
require 'open-uri'
# https://github.com/flori/json
require 'json'
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
@rmarmorstein
rmarmorstein / emailer
Created October 15, 2013 14:08
google scripts email spammer (Don't really spam with it) Educational purposes only.
function myFunction() {
var Email = "you@domain.com"
var Sbj = "Subject"
var msg = "Body"
var i =0 //Dont change this
var qty = 50 //Number of messages to send.
while(i<qty){
MailApp.sendEmail(Email, Sbj, msg);
i++
}