Skip to content

Instantly share code, notes, and snippets.

View forksofpower's full-sized avatar
:shipit:

Patrick Jones forksofpower

:shipit:
View GitHub Profile
@theoperatore
theoperatore / findRandomGame.js
Last active March 3, 2019 06:37
Get random game metadata via giant-bomb api for any platform
// depends on fetch, async/await (node 8.2.1+)
require('isomorphic-fetch');
const getAllPlatforms = async apiKey => {
const rawResponse = await fetch(`http://www.giantbomb.com/api/platforms?api_key=${apiKey}&format=json&field_list=name,id`);
const response = await rawResponse.json();
// check response.error === "OK" && repsonse.status_code === 1
return response.results;
}
@forksofpower
forksofpower / linux startup sounds.md
Last active August 18, 2023 04:53
startup sounds in linux

How to add startup sound to linux

I use this implementation on my RuneAudio player to play a sound when the raspberry pi is powered on.

  1. Place your audio file in /var/local/

    cp startupsound.mp3 /var/local/
  2. Create /usr/bin/startupsound.sh with these contents:

@wdullaer
wdullaer / install.sh
Last active June 29, 2024 11:54
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing

found at: http://fascinated.fm/post/2379188731/getting-a-motorola-sbg6580-into-bridge-mode-on

Getting a Motorola SBG6580 into “Bridge” mode on TimeWarner Wideband

  1. Unplug coax cable from Motorola
  2. Hold down the white reset button on the back panel with a pen for 30s.  This resets all settings to factory defaults. The modem will be auto-reconfigured once you plug in the coax cable.
  3. When modem is back on plug in a computer with an Ethernet cable into the modem.
  4. Connect to http://192.168.0.1 and login with “admin” / “motorola”
  5. Now you will make some changes:
 
  • Wireless -> Primary Network -> Disabled
@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};