Skip to content

Instantly share code, notes, and snippets.

View dennyweiss's full-sized avatar

Denny Weiß dennyweiss

View GitHub Profile
@dennyweiss
dennyweiss / main.mo.md
Created January 19, 2023 14:47 — forked from nomeata/main.mo.md
Certified Assets from Motoko (PoC/Tutorial)

Every now and then someone asks whether Motoko canisters can use certified variables, or whether they can serve HTTP requests with certification, and I always responded that yes, Motoko can do that, all that’s missing are a few libraries. But I figured I should put my hand where my mouth is, and actually demonstrate that it’s possible.

So here we go. If you go to https://ce7vw-haaaa-aaaai-aanva-cai.ic0.app/ you will see that

To prove the latter claim, here is the commented code; you can also browse the full repository.

main.mo

@dennyweiss
dennyweiss / gist:cc10dce6790a258447c3f9aeb368c2da
Created November 5, 2020 07:18 — forked from jaydson/gist:1780598
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){
@dennyweiss
dennyweiss / deatchable-iframe.499d27c.css
Last active November 5, 2020 09:50
detachable iframe
@keyframes detach {
0% {
position: sticky;
opacity: 0;
}
100% {
position: fixed;
opacity: 1;
}
}
@dennyweiss
dennyweiss / MicrosoftTeams-GetTeamLink.ps1
Created April 29, 2020 09:43 — forked from mrik23/MicrosoftTeams-GetTeamLink.ps1
Script to construct team link using Microsoft Teams PowerShell module
@dennyweiss
dennyweiss / [GUIDE] macos yarn nvm install.md
Created April 9, 2020 08:48 — forked from rcugut/[GUIDE] macos yarn nvm install.md
GUIDE for mac OS X yarn nvm node install

GUIDE to install yarn, nvm (node) on macOS

last update: Apr 6, 2020

Assumptions:

  • macOS >= 10.14 (Mojave)
  • homebrew properly installed
@dennyweiss
dennyweiss / gist:1e6208ea6ce341cdf105464ce882f484
Created February 20, 2020 21:16 — forked from elucify/gist:c7ccfee9f13b42f11f81
BASH: set variables for ANSI text color escape sequences
RESTORE=$(echo -en '\033[0m')
RED=$(echo -en '\033[00;31m')
GREEN=$(echo -en '\033[00;32m')
YELLOW=$(echo -en '\033[00;33m')
BLUE=$(echo -en '\033[00;34m')
MAGENTA=$(echo -en '\033[00;35m')
PURPLE=$(echo -en '\033[00;35m')
CYAN=$(echo -en '\033[00;36m')
LIGHTGRAY=$(echo -en '\033[00;37m')
LRED=$(echo -en '\033[01;31m')
@dennyweiss
dennyweiss / remove_apt_cache
Created February 15, 2020 09:22 — forked from marvell/remove_apt_cache
Remove APT cache (for Dockerfile)
apt-get clean autoclean
apt-get autoremove --yes
rm -rf /var/lib/{apt,dpkg,cache,log}/
@dennyweiss
dennyweiss / Remove all git tags
Created July 9, 2019 22:29 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@dennyweiss
dennyweiss / Git Subtree basics.md
Created April 17, 2019 19:34 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@dennyweiss
dennyweiss / Enable xdebug for PHPStorm 2018.2.md
Last active November 9, 2018 08:39
Laravel Homestead 7 – xdebug `/etc/php/7.2/mods-available/xdebug.ini`

Tasks

  1. Add xdebug.remote_autostart = 1 to /etc/php/7.2/mods-available/xdebug.ini
  2. Activate xDebug for CLI
sudo ln -s /etc/php/7.2/mods-available/xdebug.ini /etc/php/7.2/cli/conf.d/20-xdebug.ini
  1. Add Remote CLI Interpreter (vagrant)