Skip to content

Instantly share code, notes, and snippets.

View Zaxuhe's full-sized avatar

Vicente Benavent Valenzuela Zaxuhe

View GitHub Profile
@skyrocknroll
skyrocknroll / dell-loop.sh
Last active November 7, 2023 16:36
dell fan #temp #fan #ipmi #rx720d #fan #control
#!/usr/bin/env bash
# ----------------------------------------------------------------------------------
# Script for checking the temperature reported by the ambient temperature sensor,
# and if deemed too high send the raw IPMI command to enable dynamic fan control.
#
# Requires:
# ipmitool – apt-get install ipmitool
# slacktee.sh – https://github.com/course-hero/slacktee
# ----------------------------------------------------------------------------------
@NeuronButter
NeuronButter / cloudflaredtunnels.js
Last active July 27, 2023 17:16
Programmatically use cloudflared Quick Tunnels
// Original answer here https://community.cloudflare.com/t/quick-tunnel-from-nodejs/336868/3
const express = require('express');
const { spawn } = require('child_process');
let port = 8080;
// Express
let app = express();
app.get('/', (req, res) => res.send('Hi'));
app.listen(port);
require('isomorphic-fetch');
const AUTH_TYPE = require('aws-appsync/lib/link/auth-link').AUTH_TYPE;
const AWSAppSyncClient = require('aws-appsync').default;
const AmazonCognitoIdentity = require('amazon-cognito-identity-js');
const gql = require('graphql-tag');
const listMessages = gql(`
query getConversationMessages($conversationId: ID!, $after: String, $first: Int) {
allMessageConnection(conversationId: $conversationId, after: $after, first: $first) {
__typename
@mrmartineau
mrmartineau / stimulus.md
Last active July 18, 2024 07:43
Stimulus cheatsheet
@tobiasvl
tobiasvl / to_c_or_not_to_c.md
Last active July 21, 2024 23:33 — forked from ISSOtm/to_c_or_not_to_c.md
Writeup discussing when to use RGBDS or GBDK.

In the past few years, it seems that, as retro gaming has grown in popularity, programming for older platforms has also gained traction. A popular platform is the Game Boy, both for its nostalgia and (relative) ease to program for.

When someone wants to make their own game, one of the first problems they will encounter is picking the tools they will use. There are two main options: either use GBDK (Game Boy Development Kit) and the language C, or RGBDS (Rednex Game Boy Development System) and the Game Boy's assembly language.

The purpose of this document is to provide my insights and experience, and help you make the better choice if you're starting a new project. I will also provide some "good practice" tips, both for C and ASM, if you have already made up your mind or are already using one of these.

Overview

@TaylorAckley
TaylorAckley / toggle.js
Created April 7, 2017 23:18
jquery show/hide with toggleable icons
//usage --
//<i class="show-hide" data-elem="#hidden-content"></i>
//<div id="my-content" class="hidden">I'm hidden until the icon is clicked</div>
$(document).ready(function() {
$('.show-hide').on('click', function(e) {
e.preventDefault();
var elem = $(this).attr('data-elem');
$(elem).toggleClass('hidden');
$(this).toggleClass('glyphicon-menu-down');
@harold-b
harold-b / HaxeJSObject.hx
Last active June 20, 2017 20:34
Hacky haxe plain javascript object with JS for/in key value loop.
package;
typedef Union2<T1,T2> = haxe.extern.EitherType<T1,T2>;
abstract JSObject( Dynamic ) from Dynamic to Dynamic
{
public inline function new()
{
this = {};
}
@raineorshine
raineorshine / human-readable-hash-comparisons.md
Last active July 21, 2024 20:31
An aesthetic comparison of a few human-readable hashing functions.

An Aesthetic Comparison of Human-Readable
Hashing Functions

The following compares the output of several creative hash functions designed for human readability.

sha1's are merely used as arbitrary, longer, distributed input values.

input 1 word output 2 word output 3 word output
@nvd
nvd / sqs-express.js
Created May 23, 2016 12:11
Nodejs app to push/pop with SQS
//-------------------------------------
// Nodejs app to push/pop with SQS
// $ npm install aws-sdk express
// $ node sqs-express.js
//-------------------------------------
var express = require('express'),
AWS = require('aws-sdk');
AWS.config.update({
@lolson
lolson / tailLog
Created April 19, 2016 21:53
A java implementation of tail
// See JLogTailer
public void tailLog(File file) {
boolean running = true;
int updateInterval = 1000;
long filePointer = file.length();
try {
while (running) {
Thread.sleep(updateInterval);
long length = file.length();