Skip to content

Instantly share code, notes, and snippets.

Adrian Juszczak Juszczak

Block or report user

Report or block Juszczak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const isProduction = !!process.env.WEBPACK_PRODUCTION;
console.log('isProduction:', typeof isProduction);
const htmlPluginConfig = {template: './src/index.html'};
const htmlPlugin = new HtmlWebpackPlugin(htmlPluginConfig)
View Object.prototype inheritance
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;
}
View pubkey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDB4lGzMVd/nB31VcYioWWXuISXJKFQnQdyiwMVW55CPenvZQJ/aPni2/pCZVooAj4t6gpiPfNJdAuYBPc4n3b3VeiahczcQgaBq+It1LvGc40oUdMccWETj5Z59+H3zzzYNqkry31N8PqwcDCd6TNa5NTFLh24rGusrHk7FBIH7G9nTnL5Ejzh/CcQ1hMlQ72Hcxd6ANVqql+MSVDPmQHQaQAQSCEDgxoY4PljWEDUQqUgBbVckyd1MEFFdihFssUs73OL3TMuEDVxuWbBsyK/JUONpPQ1qC2xOHo2KEzywbce1JejF4eG6N9fTvOlEdZz+9ABW6LBiz4xdotl4JcDXpFawtK//9ed3zlWJjdlPSRYHV709YjNT6c6iD0k9G0uqOhuCNC8qVr5DOIDbY1iLbviQLtIjWqkTlIErF8n76JdF0zZreS9kwMS8XLv1nCktjBHd8iLUh9KGzllgtVel1/bZy4LuEvk/AksTE1/WFKm85NzVO93qSQom1HlY0+SVReUbpmhRM4/Jj7RAi0ezhAOC5ltS592yc+Xqk+HSQ25dMI9GBNItPYrPPxgexgC0QTkFIyM6e53yXpPKFDQQHZdyuLc0vLpTLgiWTQFc8p8FppCTYaiqkk82tDuoGRl78w64c3C8Fk/+YyyvOeLlXg28PxbZDSSjcRB1UL6FQ==
@Juszczak
Juszczak / base64-typescript-class.ts
Created Nov 12, 2015
TypeScript class for Base64 encoding/decoding
View base64-typescript-class.ts
class Base64 {
private PADCHAR: string = '=';
private ALPHA: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
private getByte(s: string, i: number): number {
const x = s.charCodeAt(i);
return x;
}
private getByte64(s: string, i: number): number {
View git-io-custom-url.md

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
View kpop.sh
sudo lsof -i tcp:4200 | grep LISTEN | awk '{print $2}' | xargs sudo kill -9
@Juszczak
Juszczak / .bash_profile
Created Oct 17, 2018 — forked from fane89/.bash_profile
.bash_profile
View .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"
@Juszczak
Juszczak / decamel.sh
Created Jun 29, 2018
Decamelize string in bash
View decamel.sh
#!/usr/bin/env bash
sed -e 's/\([A-Z]\)/-\1/g' -e 's/^-//' <<< "$@" | awk '{print tolower($0)}'
@Juszczak
Juszczak / compile.sh
Created Mar 22, 2018
MacOS LockScreen Util
View compile.sh
clang -framework Foundation lock.m -o lock
@Juszczak
Juszczak / fast-ip.sh
Created Mar 20, 2018
Fast IP info by greping ifconfig for local and DNS lookup for global (used as tmux plugin)
View fast-ip.sh
#!/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"
You can’t perform that action at this time.