Skip to content

Instantly share code, notes, and snippets.

View alirezahi's full-sized avatar
🏀
Happy to be Busy

Alireza Heydari alirezahi

🏀
Happy to be Busy
View GitHub Profile
'STATIC_KW',
'BOOLEAN_KW',
'CHARACTER_KW',
'INTEGER_KW',
'CHAR_KW',
'BOOL_KW',
'INT_KW',
'VOID_KW',
'IF_KW',
'OTHER_KW',
reserved = {
'static': 'STATIC_KW',
'boolean': 'BOOLEAN_KW',
'character': 'CHARACTER_KW',
'integer': 'INTEGER_KW',
'char': 'CHAR_KW',
'bool': 'BOOL_KW',
'int': 'INT_KW',
'void': 'VOID_KW',
'if': 'IF_KW',
const uniqueArray = things.thing.filter((thing,index) => {
return index === things.thing.findIndex(obj => {
return JSON.stringify(obj) === JSON.stringify(thing);
});
});
npm install npm@latest -g
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
fetchUserInfo() {
this.userInfo.init();
ajaxWithJWT({
url: `${serverUrls.crm}/api/v2/user-management/whoami/`,
})
.then(res => {
const { data } = res;
this.$store.commit('setUser', data);
this.$store.commit('setPanelConfig', data);
this.$store.commit(
function duplicateCount(text){
return (text.toLowerCase().split('').sort().join('').match(/([^])\1+/g) || []).length;
}
{"lastUpload":"2020-01-18T08:30:44.149Z","extensionVersion":"v3.4.3"}
# install chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
# install zsh
sudo apt-get install zsh curl git
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# install yarn
@alirezahi
alirezahi / baywatch.js
Created February 4, 2020 08:07
Bulk Watch for Vue
export default {
methods: {
baywatch: function(props, watcher) {
const iterator = function(prop) {
this.$watch(prop, function(newVal, oldVal) {
watcher(newVal, oldVal, prop);
});
};
props.forEach(iterator, this);
},
@alirezahi
alirezahi / tor.sh
Last active February 16, 2020 19:18
sudo apt-get install tor
sudo service tor start
# check tor:
# curl --socks5 localhost:9050 --socks5-hostname localhost:9050 -s https://check.torproject.org/ | cat | grep -m 1 Congratulations | xargs
pip install stem
pip install requests
pip install requests[socks]
pip install requests[security]
# if error on the above command: