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
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
boot.loader.grub.enable = true; | |
boot.loader.grub.version = 2; |
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
[build] | |
command = "npm run build" | |
publish = "dist" | |
[build.environment] | |
NODE_ENV = "production" | |
NPM_CONFIG_AUDIT = "false" | |
NPM_CONFIG_FUND = "false" | |
NPM_FLAGS = "--ignore-scripts" |
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 resultState = state => { | |
if (!inputMatchesResult(state)) { | |
return 'unsynced'; | |
} else if (state.isCalculating) { | |
return 'loading'; | |
} else if (!state.result.success) { | |
return 'error'; | |
} else if (state.result.success) { | |
return 'success'; | |
} |
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
// ==UserScript== | |
// @name Mark watched YouTube videos | |
// @version 5 | |
// @match https://www.youtube.com/feed/subscriptions | |
// @description Mark watched YouTube videos more prominently. | |
// @namespace https://gist.github.com/Siilwyn/ | |
// @homepageURL https://gist.github.com/Siilwyn/669bb2b69cf039a02b6f209415a312f9/ | |
// @downloadURL https://gist.githubusercontent.com/Siilwyn/669bb2b69cf039a02b6f209415a312f9/raw/userscript.js | |
// @updateURL https://gist.githubusercontent.com/Siilwyn/669bb2b69cf039a02b6f209415a312f9/raw/userscript.js | |
// @grant GM_addStyle |
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 { | |
Async, constant, curry, | |
mapReduce, maybeToAsync, | |
safe | |
} = require('crocks') | |
// FileAsync :: Async Error String | |
// access :: (String, Number) -> Async Error () | |
const access = |
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
use std::io::{Read, Write, BufReader, BufRead}; | |
use std::net::{TcpListener, TcpStream}; | |
fn main() { | |
loop { | |
let listener = TcpListener::bind("localhost:5432").unwrap(); | |
let stream = listener.accept().unwrap().0; | |
handle_request(stream); | |
} | |
} |
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
test('expect a reject', (t) => | |
rejectSomething() | |
.then(t.fail) | |
.catch(error => t.is(error, 'bla')) | |
) | |
test('expect a resolve', (t) => | |
resolveSomething() | |
.then(result => t.is(result, 'hey')) | |
) |
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
/* Assuming: */ | |
{ | |
user: 1, | |
paymentMethod: 3 | |
item: 51, | |
date: 1481892890, /* epoch timestamp */ | |
payments: [{ | |
payment: 44, | |
amountCents: 400, |
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
async function displaySteamApps() { | |
const paths = await getSteamAppsPaths(); | |
const appIdLibraries = await Promise.all(paths.map(getSteamAppIds)); | |
const appIds = Array.prototype.concat.apply([], appIdLibraries); | |
const appsData = appIds.map(getSteamAppInfo); | |
appsData.forEach(function (appData) { | |
Promise.resolve(appData).then(renderSteamApp); | |
}); | |
}; |
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 getConfigDirectory = function () { | |
var platform = process.platform; | |
if (platform === 'linux') { | |
return process.env.XDG_CONFIG_HOME || path.join(home(), '.config') | |
} | |
else if (platform === 'darwin') { | |
return path.join(home(), 'Library', 'Preferences'); | |
} | |
else if (platform === 'win32') { |
NewerOlder