Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
mkdir -p ~/.ansible/{host_vars,group_vars,roles}
wget -O ~/.ansible.cfg https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg
touch ~/.ansible/hosts
@mashimom
mashimom / .gitattributes
Created July 18, 2020 09:57 — forked from amalloy/.gitattributes
Clojure-aware git-diff hunk headers
*.clj diff=clojure
*.cljs diff=clojure
*.cljx diff=clojure
//*
// Target is to take strings representing binary numbers parcels,
// sum them (binary fashion) and return string representing the resulting binary number
// for the reference same code is one line in Clojure,
// which also works for arbritary number of parcels but it is limited by integer representation:
// <pre>(defn bin-sum [bns] (Integer/toString (apply + (map parse-bin bns)) 2))</pre>
//*
class Solution {
public String addBinary(String a, String b) {
int minLength = a.length() < b.length() ? a.length() : b.length();
@mashimom
mashimom / Solution.java
Created September 23, 2020 15:39
faster - longest substring without repeating characters
class Solution {
public int lengthOfLongestSubstring(String s) {
int r = 0;
Set<Character> set;
for(int i=0;i<s.length();i++) {
set = new HashSet<>();
int t = 0;
for(int j=i;j<s.length();j++){
if(set.contains(s.charAt(j))) break;