Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Juan Roa roadev

🎯
Focusing
View GitHub Profile
@digitalspaceport
digitalspaceport / gist:d8904efda4d5997a2f0e9caf31cff1c3
Last active Jun 24, 2021
1 liner to compile MadMax Chia plotter for Centos 7.
View gist:d8904efda4d5997a2f0e9caf31cff1c3
yum -y update
yum install vim -y
yum install htop -y
yum install git -y
yum -y install epel-release -y
yum install cmake3 gmp-devel libsodium gmp-static libsodium-static -y
yum -y install centos-release-scl -y
yum -y install cmake3 -y
sudo alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
@mrpeardotnet
mrpeardotnet / PVE-HP-ssacli-smart-storage-admin.md
Created Nov 25, 2019
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)
View PVE-HP-ssacli-smart-storage-admin.md

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@TRPB
TRPB / arch-macbook2018.md
Last active Sep 28, 2022
Guide: Running Arch on a 2018 MacBook Pro
View arch-macbook2018.md

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
@richard-flosi
richard-flosi / star-wars-planets.html
Last active Sep 14, 2022
Web Component using Custom Element, Shadow DOM, fetch, async/await, and the Star Wars API
View star-wars-planets.html
<html>
<head>
<script>
customElements.define("star-wars-planets", class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
}
static get observedAttributes() { return ["loading", "planets"]; }
@muZk
muZk / README.md
Created Dec 12, 2017
How to use hover with react-jss
View README.md

How to use hover with react-jss

Let's say we have the following style:

const styles = (theme) => ({
  title: {
    color: theme.color,
  },
})
@alea12
alea12 / crontab
Created Mar 28, 2017
Nginx + Let's Encrypt + Rails5 + Puma
View crontab
00 05 01 * * /home/alea12/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html -d example.net --renew-by-default && nginx -t && nginx -s reload
View import_csv_rg_mailer.rb
require 'csv'
CSV.foreach('app/services/rg_list.csv', headers: true) do |row|
Person.find_or_create_by name: row['Name'].to_s.split.map(&:capitalize).join(' '), email: row['Email'].to_s.downcase, gender: row['Gender'].to_s.downcase
end
CSV.foreach('app/services/rg17_register_full.csv', headers: true) do |row|
Person.find_or_create_by name: row['Name'].to_s.split.map(&:capitalize).join(' '), email: row['Email'].to_s.downcase.strip, gender: row['Gender'].to_s.downcase, register_date: row['register_date'].to_s.downcase, birth_date: row['birth_date'].to_s, phone: row['phone'].to_s.downcase.strip, level: row['level'].to_s.downcase, motivation: row['motivation'].to_s.downcase, heard_ror: row['heard_ror'].to_s.downcase, laptop: row['laptop'].to_s.downcase, so: row['so'].to_s.downcase, expectation: row['expectation'].to_s.downcase, how_did_you_find_it: row['how_did_you_find_it'].to_s.downcase
end
@arteezy
arteezy / puma.service
Last active Sep 14, 2022
Manage Puma with systemd and rbenv
View puma.service
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
View jQuery insert before
<!-- in the header -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="scripts/jquery-2.1.1.min.js"><\/script>')</script>
<!-- document ready -->
<script>
$(document).ready(function() {
var customHTML = "<h2>Jeg elsker brød</h2>"
View gist:f08c65400a46c470d29b6fc6da300f23
/**
* An implementation for Quicksort. Doesn't
* perform as well as the native Array.sort
* and also runs the risk of a stack overflow
*
* Tests with:
*
* var array = [];
* for(var i = 0; i < 20; i++) {
* array.push(Math.round(Math.random() * 100));