Skip to content

Instantly share code, notes, and snippets.

View mwojtera's full-sized avatar

Michał Wojtera mwojtera

  • Politechnika Łódzka
  • Łódź, Poland
View GitHub Profile
@webdevotion
webdevotion / .bash_profile
Last active December 21, 2020 10:17
Fancy bash shell
# READ MORE HERE: http://www.webdevotion.be/blog/2012/06/06/terminal-git-branch-status-colored-icons
# ==============================================================================
# FANCY GIT STATUS ICONS
# ==============================================================================
# SOME VARIABLES in capitals
# no whitespace between variable names and = sign!
COLOR_RESET="\e[00m"
COLOR_GREEN="\e[1;32m"
COLOR_RED="\e[00;31m"
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@aktau
aktau / imessage
Last active June 11, 2023 20:30
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
@josephabrahams
josephabrahams / mavericks-iso.sh
Created September 13, 2014 22:20
Create a bootable ISO from the OS X Mavericks app
#!/bin/sh
# Create a bootable ISO from the OS X Mavericks app
# http://thezinx.com/misc/trend/create-bootable-dmg-iso-mavericks-app/
if [ ! -f /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg ]; then
echo "Download the OS X Mavericks App and then rerun this script."
open "https://itunes.apple.com/us/app/os-x-mavericks/id675248567"
exit 1
fi
@Yimiprod
Yimiprod / difference.js
Last active June 20, 2024 08:26
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@sam-artuso
sam-artuso / setting-up-babel-nodemon.md
Last active November 3, 2023 08:52
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@elliot-huffman
elliot-huffman / .gitignore
Last active February 21, 2022 22:58
A gitignore for all of your Apache Cordova needs.
# Cordova Global
plugins/
# iOS Platform
platforms/ios/build/
platforms/ios/www/
platforms/ios/cordova/console.log
*.xcuserdatad
# Android Platform
@cheungnj
cheungnj / script.sh
Last active March 6, 2024 02:35
Convert asciidoc to Github Flavored Markdown
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb
# Convert asciidoc to docbook using asciidoctor
@juanpicado
juanpicado / org.verdaccio.launcher.plist
Last active June 7, 2023 19:06
verdaccio on mac as a service
# ~/Library/LaunchAgents/org.verdaccio.launcher.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.verdaccio.launcher</string>
<key>Program</key>
<string>/Users/user/Scripts/verdaccio.sh</string>
<key>RunAtLoad</key>