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
@kylehowells
kylehowells / FileWatcher.cs
Created May 9, 2019 13:06
Monitor iOS files for changes using GCD dispatch_source_create DISPATCH_SOURCE_TYPE_VNODE in Xamarin
using System;
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using System.IO;
namespace LoadRuntimeXAML.iOS
{
public class FileWatcher : IDisposable
{
Delete VCP ports while switches are stacked
Evidently, Juniper disregards it's own terminology "fpc" in favor of going straight to "pic" in referring to each switch in the stack.
Odd...
Commands used to delete VCP on ports where two switches are stacked:
"fpc0" (switch 0)
QSFP 0: request virtual-chassis vc-port delete pic-slot 0 member 1 port 0
@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>
@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
@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
@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
@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

@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) {
@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
@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