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
package sbt | |
package internal | |
package fix | |
import scalafix.v1._ | |
import scala.meta._ | |
class Sbt0_13BuildSyntax extends SyntacticRule("Sbt0_13BuildSyntax") { | |
override def fix(implicit doc: SyntacticDocument): Patch = { | |
doc.tree.collect { |
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
# Create a dictionary that can only hold integers and floats as its values | |
class IntFloatValueError(Exception): | |
def __init__(self, value): | |
self.value = value | |
def __str__(self): | |
return '{} is invalid input, CustomIntFloatDict can only accept ' \ | |
'integers and floats as its values'.format(self.value) |
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
#!/usr/bin/env python3 | |
import asyncio | |
import multiprocessing | |
import os | |
import ssl | |
from time import sleep | |
port = 9000 |
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
Vagrant::Config.run do |config| | |
# ... | |
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
end |
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
# Non-root account is recommended for this process | |
# centos-specific prepration | |
sudo yum -y update && sudo yum -y groupinstall 'Development Tools' && sudo yum -y install curl irb m4 ruby | |
# Sanitize the environment | |
PATH=~/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin | |
unset LD_LIBRARY_PATH PKG_CONFIG_PATH | |
# install linuxbrew |
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
#!/bin/sh | |
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/ | |
set -e | |
# Install dependencies. | |
sudo apt install -y curl apt-transport-https \ | |
software-properties-common ca-certificates | |
# Install docker. |
This script is modeled after tee
(see [man tee
][2]) and works on Linux, macOS, Cygwin, WSL/WSL2
It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.
This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]
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
# Advanced Bash :: Array slicing and compaction in bash | |
# TL;DR | |
X=(something 'whatever' "i have more S P A C E S than i can give away. arent you jealous?") | |
# ${X[@]} the usual whole array | |
# ${X[@]:index:length} slice from index to index+length-1 inclusive | |
# ${X[@]::length} slice from 0 to length-1 inclusive | |
# ${X[@]:index} slice from index to end of array inclusive |
NewerOlder