Skip to content

Instantly share code, notes, and snippets.

View Juszczak's full-sized avatar

Adrian Juszczak Juszczak

View GitHub Profile
@Juszczak
Juszczak / angular.html
Created January 25, 2018 22:31
AngularJS witch dependencies from Google CDN
<!-- angular -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<!-- angular material styles -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
<!-- angular material dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>
@Juszczak
Juszczak / TrueColour.md
Created February 6, 2018 20:17 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@Juszczak
Juszczak / fast-ip.sh
Created March 20, 2018 14:25
Fast IP info by greping ifconfig for local and DNS lookup for global (used as tmux plugin)
#!/usr/bin/env bash
declare glob; glob="$(dig +short myip.opendns.com @resolver1.opendns.com)";
declare local; local="$(ifconfig en4 | grep 'inet ' | awk '{print $2}')"
declare out; out="$local | $glob"
echo "$out"
@Juszczak
Juszczak / compile.sh
Created March 22, 2018 11:55
MacOS LockScreen Util
clang -framework Foundation lock.m -o lock
@Juszczak
Juszczak / decamel.sh
Created June 29, 2018 13:02
Decamelize string in bash
#!/usr/bin/env bash
sed -e 's/\([A-Z]\)/-\1/g' -e 's/^-//' <<< "$@" | awk '{print tolower($0)}'
@Juszczak
Juszczak / .bash_profile
Created October 17, 2018 15:11 — forked from vodrazka/.bash_profile
.bash_profile
export VISUAL=vim
export EDITOR="$VISUAL"
green=$(tput setaf 2)
reset=$(tput sgr0)
PS1="\w \[$green\]$\[$reset\] "
stty -ixon
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
sudo lsof -i tcp:4200 | grep LISTEN | awk '{print $2}' | xargs sudo kill -9
@Juszczak
Juszczak / git-io-custom-url.md
Created November 22, 2018 10:30 — forked from dikiaap/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDB4lGzMVd/nB31VcYioWWXuISXJKFQnQdyiwMVW55CPenvZQJ/aPni2/pCZVooAj4t6gpiPfNJdAuYBPc4n3b3VeiahczcQgaBq+It1LvGc40oUdMccWETj5Z59+H3zzzYNqkry31N8PqwcDCd6TNa5NTFLh24rGusrHk7FBIH7G9nTnL5Ejzh/CcQ1hMlQ72Hcxd6ANVqql+MSVDPmQHQaQAQSCEDgxoY4PljWEDUQqUgBbVckyd1MEFFdihFssUs73OL3TMuEDVxuWbBsyK/JUONpPQ1qC2xOHo2KEzywbce1JejF4eG6N9fTvOlEdZz+9ABW6LBiz4xdotl4JcDXpFawtK//9ed3zlWJjdlPSRYHV709YjNT6c6iD0k9G0uqOhuCNC8qVr5DOIDbY1iLbviQLtIjWqkTlIErF8n76JdF0zZreS9kwMS8XLv1nCktjBHd8iLUh9KGzllgtVel1/bZy4LuEvk/AksTE1/WFKm85NzVO93qSQom1HlY0+SVReUbpmhRM4/Jj7RAi0ezhAOC5ltS592yc+Xqk+HSQ25dMI9GBNItPYrPPxgexgC0QTkFIyM6e53yXpPKFDQQHZdyuLc0vLpTLgiWTQFc8p8FppCTYaiqkk82tDuoGRl78w64c3C8Fk/+YyyvOeLlXg28PxbZDSSjcRB1UL6FQ==
function Person(name) {
this.name = name;
}
Person.prototype.sayHello = function() { console.log('Hello, my name is ' + this.name + '!'); }
function Student(name, id) {
Person.call(this, name);
this.id = id;
}