How to setup DigitalOcean's Droplet with Ubuntu 16.04 + UFW + NGINX + SSL + F2B
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 work = process._getActiveHandles().length + process._getActiveRequests().length; | |
foo(); | |
var newWork = (process._getActiveHandles().length + process._getActiveRequests().length) - work; | |
if(newWork > 0) { | |
console.log("asynchronous work took place."); | |
} |
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
/* | |
* Assume s is a string of lower case characters. | |
* | |
* Write a program that prints the longest substring of s | |
* in which the letters occur in alphabetical order. | |
* | |
* For example, if s = 'azcbobobegghakl', then your program should print | |
* "Longest substring in alphabetical order is: beggh" | |
* | |
* In the case of ties, print the first substring. |
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
// Warning: maximum value for a variable of type Number (no bitwise or shift operators allowed): 9,007,199,254,740,991 | |
let x = parseInt(process.argv[2]); | |
if(isNaN(x)) process.exit(1); | |
else{ | |
if(x < 1){ | |
process.exit(1); | |
} | |
else{ | |
let n = 0; console.log(`${n} ${x}`); | |
while (x !== 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
// Warning: maximum value for a variable of type int: 2,147,483,647 | |
#include <stdio.h> | |
int main(int argc, char *argv[]){ | |
if(argc == 2){ | |
int x = atoi(argv[1]); int n = 0; printf("%i %i\n",n,x); | |
if(x < 1){ | |
exit(1); | |
} | |
else{ | |
while(x != 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
git config --global user.email "[email protected]" | |
git rebase -i | |
git commit --amend --reset-author | |
git rebase --continue | |
git push |
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/bash | |
sudo apt-get install curl zsh git | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
cd ~/.oh-my-zsh/custom/plugins && \ | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting && \ | |
curl -s https://gist.githubusercontent.com/wizo06/3dce572a8ba5ff7ddbf120829f541b7c/raw/d9ebbd0a3935264bf9cc2777a62aa887bf57d9a9/wizo-min.zsh-theme > ~/.oh-my-zsh/custom/themes/wizo-min.zsh-theme && \ | |
sed 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="wizo-min"/' ~/.zshrc > ~/.zshrc_new && mv ~/.zshrc_new ~/.zshrc && \ | |
sed 's/^plugins=(git)/plugins=(git zsh-syntax-highlighting)/' ~/.zshrc > ~/.zshrc_new && mv ~/.zshrc_new ~/.zshrc && \ | |
source ~/.zshrc |
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
local date='%F{008}%D{%Y.%m.%d}%f' | |
local time='%F{008}%*%f' | |
local timezone='%F{008}%D{%Z}%f' | |
local user='%B%F{129}%n%f%b' | |
local machine='%B%F{045}%m%f%b' | |
local current_dir='%B%F{147}%~%f%b' | |
local git_info='%B$(git_prompt_info)%b' | |
PROMPT="${user}@${machine} in ${current_dir} ${git_info} | |
%F{015}$%f " |
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
kana_dict = { | |
'あ': '安', | |
'ア': '阿', | |
'い': '以', | |
'イ': '伊', | |
'う': '宇', | |
'ウ': '宇', | |
'え': '衣', | |
'エ': '江', | |
'お': '於', |
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
sudo add-apt-repository ppa:openrazer/stable | |
sudo apt update | |
sudo apt install openrazer-meta | |
sudo modprobe razerkbd | |
xinput set-prop "AT Raw Set 2 keyboard" "Device Enabled" 0 | |
cd /etc/X11/ | |
sudo mkdir xorg.conf.d | |
cd xorg.conf.d/ | |
sudo touch 20-razer.conf | |
sudo nano 20-razer.conf |
OlderNewer