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 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; |
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
//* | |
// 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(); |
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
*.clj diff=clojure | |
*.cljs diff=clojure | |
*.cljx diff=clojure |
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 | |
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 |
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 | |
sudo apt install python-setuptools python-dev build-essential | |
sudo easy_install pip | |
sudo pip 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 | |
echo "[all]" >> ~/.ansible/hosts |
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
pgrep -l xfce | |
## returns: 14306 xfce4-terminal |
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.configure("2") do |config| | |
config.vm.box = 'your-box' | |
if Vagrant.has_plugin?("vagrant-cachier") | |
# Configure cached packages to be shared between instances of the same base box. | |
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage | |
config.cache.scope = :box | |
# OPTIONAL: If you are using VirtualBox, you might want to use that to enable | |
# NFS for shared folders. This is also very useful for vagrant-libvirt if you | |
# want bi-directional sync |
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
alias prn="print -l $@" |
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
alias fnd="realpath $@" |
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
rsync <params like -vritzn> --bwlimit=8000 ./ <USER>@<HOSTNAME>:<PATH> |
NewerOlder