Skip to content

Instantly share code, notes, and snippets.

View dimitardanailov's full-sized avatar

Dimitar Danailov (a.k.a Mitco) dimitardanailov

View GitHub Profile
@dimitardanailov
dimitardanailov / isPrime.java
Last active October 8, 2016 14:20
Java imperative or functional
public static boolean isPrimeFunctionalStyle(int number) {
return number > 1 &&
IntStream.rangeClosed(2, (int) Math.sqrt(number))
.noneMatch(i -> number % i == 0);
}
@dimitardanailov
dimitardanailov / .bash_profile_dotnet
Created September 20, 2016 08:06
zsh + dotnet + mac os x
export DOTNET_DIR=/usr/local/share/dotnet
export PATH=$DOTNET_DIR:$PATH
@dimitardanailov
dimitardanailov / .zshrc
Last active August 26, 2024 13:34
My personal zsh and tmux configurations
# Path to your oh-my-zsh installation.
export ZSH=/Users/dimitar.danailov/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"
@dimitardanailov
dimitardanailov / 01.crazy-towns.md
Last active June 9, 2016 12:05
Front-end Lightning Talks: Object Oriented CSS Framework and Crazy Towns

Crazy Towns

It’s all about the key selector

What determines the impact of a selector is its key selector. The key selector is a very important thing in the world of CSS as browsers read selectors right to left. This means the key selector is the last one before the opening {, for example:

.header ul      { /* ‘ul’ is the key selector */ }
.ul li a        { /* ‘a’ is the key selector */ }
p:last-child { /* ‘:last-child’ is the key selector */ }
@dimitardanailov
dimitardanailov / sass-compile.md
Last active April 9, 2016 13:17
sass compile script
### Compile scss files
./sass-compile.sh 

### Compile scss files and watch folder
./sass-compile.sh --watch
@dimitardanailov
dimitardanailov / 01-controllers-to-components.md
Last active August 11, 2022 01:25
Angular 2 and Typescript. Thank you to John Papa for awesome online course: http://www.johnpapa.net/angular-2-first-look

Angular 1

<body ng-controller="StoryController as vm">
  <h3>{{ vm.story.name }}</h3>
  <h3 ng-bind="vm.story.name"></h3>
</body>
@dimitardanailov
dimitardanailov / terminal-tips.sh
Last active March 29, 2016 07:00
Tips and tricks for terminal
# Terminal Tip: Use curly brackets to speed up the creation of multiple files with similar names:
touch store-{products,cart,utils,coupouns}.js
/// <reference path="../../typings/angularjs/angular.d.ts" />
/// <reference path="../../typings/angularjs/angular-route.d.ts" />
/// <reference path="../configurations/routes.ts" />
/// <reference path="../models/viewmodels/countryviewmodels/countrylistitem.ts" />
/// <reference path="../models/viewmodels/productviewmodels/productviewmodelitem.ts" />
/// <reference path="../services/database/applicationusershippingaddressdatabaseservice.ts" />
/// <reference path="../entities/dom/formelements/form/form.ts" />
/// <reference path="../entities/dom/formelements/submitbutton/submitbutton.ts" />
@dimitardanailov
dimitardanailov / 01: basic types.ts
Last active April 22, 2023 13:45
Typescript in action
/**
* Boolean
*
* The most basic datatype is the simple true/false value,
* which JavaScript and TypeScript (as well as other languages) call a 'boolean' value.
*/
var isDone: boolean = false;
/**
* Number