Skip to content

Instantly share code, notes, and snippets.

View syxanash's full-sized avatar

Simone Marzulli or simply /^syx.*$/ syxanash

View GitHub Profile
require 'faye/websocket'
require 'eventmachine'
require 'rest-client'
SMART_BULB = {
ip: 'shelly_ip_addr',
user: 'shelly_user',
password: 'shelly_password'
}
@syxanash
syxanash / DVD.py
Created July 24, 2023 15:32
DVD bouncing logo for Thumby
import thumby
import random
bitmap0 = bytearray([0,0,0,247,247,247,7,7,15,31,127,255,247,15,127,252,240,0,0,240,252,63,63,247,247,247,7,7,7,15,30,62,252,240,0,0,
0,0,0,63,63,63,56,56,56,60,30,31,7,0,0,0,7,126,252,127,7,0,0,63,63,63,56,56,56,60,30,30,7,3,0,0,
16,56,56,124,124,124,254,254,254,254,255,255,255,239,239,199,199,199,199,199,199,239,239,255,255,255,254,254,254,254,254,254,124,56,56,16,
0,0,12,16,32,16,12,0,0,0,0,61,1,1,1,1,1,61,37,25,1,1,1,1,1,61,44,36,0,0,0,24,36,36,24,0])
sprite_width = 36
sprite_height = 30
@syxanash
syxanash / ole.js
Last active May 25, 2023 10:14
Bookmarklet that extracts links from a Hacker News thread
// OLÉ - Orange Link Extractor
// bookmarklet that extracts links from a Hacker News thread
// https://www.yourjs.com/bookmarklet/
if (window.location.hostname !== "news.ycombinator.com") {
const url = `https://hn.algolia.com/?q=${window.location.href}`;
window.open(url, '_blank').focus();
@syxanash
syxanash / legobox_generator.rb
Created February 1, 2023 10:30
script to generate LEGO Minifigure Factory box
def add_zero(number)
number.size == 1 ? "0#{number}" : number
end
def byte_check_calculator(byte_string)
# execute a xor on the bytes of the string
byte_string.split(" ")
.map { |item| item.to_i(16) }
.reduce { |acc, item| acc ^ item }.to_s(16).upcase
end
@syxanash
syxanash / findup.js
Last active January 5, 2023 17:04
quick and dirty find duplicate urls in sample.json file
const fs = require('fs');
const _ = require('lodash');
fs.readFile('sample.json', 'utf8', (err, data) => {
if (err) {
console.error(err);
return;
}
const websiteLinks = JSON.parse(data);
@syxanash
syxanash / whoishome.rb
Last active June 4, 2023 13:51
who is home?
require 'rest-client'
require 'json'
=begin
Endpoint url must return something like this:
[
{
"name": "television-sony",
"mac": "00:11:22:33:44:55",
"display": false
@syxanash
syxanash / Pizza Recipe.md
Last active March 27, 2024 12:01
My Pizza Recipe

Pizza Recipe

pizza recipe

Hi I'm Simone! This recipe was developed based on some tips I acquired over time from lots and lots of resources and tutorials like youtube videos, family and friends recipes. I'm just an amateur who likes making pizza :)

If you plan to perfectionate your pizza making skills, I suggest to come up with your own recipe and research online watching lots of tutorials and different techniques. For now the following recipe is the one that works for me!

(I'm not a professional pizzaiolo and I never had any sort of experience in a professional pizzeria restaurant)

Ingredients and quantities

@syxanash
syxanash / genio.rb
Last active March 20, 2023 12:46
lyrics downloader from genius.com with API+Scraping 🏴‍☠️
require 'rest-client'
require 'nokogiri'
require 'genius'
require 'similar_text'
require 'optparse'
GENIUS_CLIENT_TOKEN = 'YOUR API TOKEN GOES HERE!!!'.freeze
class LyricsNotFound < StandardError; end
@syxanash
syxanash / dash_scan.rb
Last active January 31, 2021 17:24
little scripts that checks when amazon dash is connected to wifi network
require 'arp_scan'
# the following variables may need to be edited
dash_mac = '00:00:00:00:00:00'
interface = 'en0'
already_checked = false;
loop do
#puts "scanning network..."
@syxanash
syxanash / rollerblade.cow
Last active November 6, 2016 13:49
a cowsay file here's what it looks like: http://i.imgur.com/8o1MSUh.png
## (c) 2011 Syxanash <syxanash@gmail.com>
##
$the_cow = <<EOC;
$thoughts ____
$thoughts / \\
$thoughts /mmmmmm\\ ---------------------------
$thoughts d| L L |b
'.\\ o/.'..
||| ___| |___ ``. --------------------
(~)/ / ) \\ / ( \\ ``.