This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name: checkDisk.sh | |
# Created by: Brimur | |
# Created: Nov 26th 2019 | |
# This script is used to control Transmission jobs based on available disk space. | |
# | |
# This should be run as a cronjob (every minute) on the server/computer running Transmission | |
# | |
# If you use a download manager tell it to add jobs as PAUSED | |
# | |
# - If disk is nearly full (limit) then stop all jobs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const execSync = require('child_process').execSync; | |
const CHANNELS_PER_RUN = 8; | |
function appendLog(string) { | |
fs.appendFileSync('log.txt', `${new Date().toUTCString()} - ${string}\n`, () => {}); | |
} | |
let channels = fs.readFileSync('channels.txt', 'utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HashTable = function() { | |
this._storage = []; | |
this._count = 0; | |
this._limit = 8; | |
} | |
HashTable.prototype.insert = function(key, value) { | |
//create an index for our storage location by passing it through our hashing function | |
var index = this.hashFunc(key, this._limit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
todos: ['wake up', 'eat a breakfast', 'try to take over the world'], | |
value: '' | |
} | |
this.handleChange = this.handleChange.bind(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var generate = function(numRows) { | |
var result = [1]; | |
if(numRows === 1) { | |
return []; | |
} | |
var container = [1,1]; | |
if (numRows > 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function billTotal(subtotal) { | |
let tax = subtotal * 0.15; | |
let tip = subtotal * 0.095; | |
return subtotal + tax + tip; | |
} | |
function range(start, end) { | |
let resultArr = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```javascript | |
function renderInventory(inventory) { | |
for (let i = 0; i < inventory.length; i++) { | |
for (let j = 0; j < inventory[i].shoes.length; j++) { | |
return `${inventory[i].name}, ${inventory[i].shoes[j].name}, ${inventory[i].shoes[j].price}`; | |
} | |
} | |
} | |
let currentInventory = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renderInventory(inventory) { | |
for (let i = 0; i < inventory.length; i++) { | |
for (let j = 0; j < inventory[i].shoes.length; j++) { | |
return `${inventory[i].name}, ${inventory[i].shoes[j].name}, ${inventory[i].shoes[j].price}`; | |
} | |
} | |
} | |
let currentInventory = [ | |
{ |