Skip to content

Instantly share code, notes, and snippets.

@thehulke
thehulke / .zshrc
Last active December 26, 2019 15:03
My .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/lior/.oh-my-zsh"
ZSH_THEME="powerlevel9k/powerlevel9k"
################ start custom oh my zsh configs
POWERLEVEL9K_MODE='nerdfont-complete'
@thehulke
thehulke / calculateAvg.js
Last active January 26, 2019 19:16
Testing MEDIUM
const harry = [
{
name: 'Math',
grade: 95
},
{
name: 'Good Magic',
grade: 100
},
{
@thehulke
thehulke / es5.js
Last active November 30, 2017 14:35
Array.prototype.map
var carsCharsLength = cars.map(function(car){
return car.length;
});
@thehulke
thehulke / .functions
Created November 14, 2017 14:45
lazy tfs checkin
# Allows to chekin TFS files and associate them to a workItem if needed.
function lazytf() {
while(true)
do
clear
read -p "Checkin comment: " checkinComment
printf "Do you want to associate a workItem? [y]/[n] \n"
printf "#######################################\n"
@thehulke
thehulke / .eslintrc
Last active October 17, 2017 07:38
.eslintrc + jsconfig
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
" Use the Solarized Dark theme
"set background=dark
"colorscheme solarized
"let g:solarized_termtrans=1
" Make Vim more useful
set nocompatible
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
set clipboard=unnamed
" Enhance command-line completion
@thehulke
thehulke / TableToExcel.js
Created July 25, 2017 08:14
Export table to excel
var tableToExcel = (function () {
var uri = 'data:application/vnd.ms-excel;base64,',
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
base64 = function (s) {
return window.btoa(unescape(encodeURIComponent(s)))
},
format = function (s, c) {
return s.replace(/{(\w+)}/g, function (m, p) {
return c[p];
})
// Spread Example
let obj = {
hero : "Superman",
firstName : "Clark"
}
let lastName = "Kent";
let newObj = {
...obj,
lastName