Skip to content

Instantly share code, notes, and snippets.

View TheTrigger's full-sized avatar
🎯
Focusing

ƒabio TheTrigger

🎯
Focusing
View GitHub Profile
@TheTrigger
TheTrigger / challenge1.php
Created December 12, 2018 16:35
PHP Challenge #1
<pre><?php
//Colori a disposizione
$COLORI = array("RED", "GREEN", "ORANGE", "BLUE", "YELLOW", "BLACK");
//Creo la matrice in maniera randomica
for ($i = 0; $i < 5; $i++) {
for ($j = 0; $j < 5; $j++) {
$Matrix[$i][$j] = $COLORI[rand(0, count($COLORI) - 1)];
}
}
@TheTrigger
TheTrigger / vue-uppercase.js
Created May 21, 2019 11:48
vuejs uppercase directive
Vue.directive("uppercase", {
twoWay: true,
// TODO: unbind
unbind: () => {},
bind: function (el, binding, vnode) {
const findVModelName = vnode => {
try {
// https://forum.vuejs.org/t/solved-how-can-you-update-the-v-model-from-a-custom-directive-in-vue-2/2275
return vnode.data.directives.find(o => {
return o.name === "model";
@TheTrigger
TheTrigger / gist:6efa6a8e42eedf1e61e0db8e9ef4360a
Last active June 5, 2019 12:09
C# snippet to display ctrl chars
using System.Text;
namespace CtrlCharReplace
{
public static class Extensions
{
public static string ReplaceCtrl(this string s)
{
var sb = new StringBuilder();
for (int i = 0; i < s.Length; i++)
@TheTrigger
TheTrigger / nuget.yml
Created October 25, 2019 14:10
GitHib Actions publish to NuGet.org
name: NuGet Generation
on:
push:
branches:
- master
jobs:
build:
runs-on: windows-latest
@TheTrigger
TheTrigger / install.sh
Last active May 11, 2020 13:05
vm-tools hyper-v ubuntu 20.04
#!/bin/bash
#
# This script is for Ubuntu 18.04 Bionic Beaver to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
# https://github.com/microsoft/linux-vm-tools/blob/master/ubuntu/18.04/install.sh
###############################################################################
@TheTrigger
TheTrigger / boxstarter.ps1
Last active October 19, 2023 17:35
BoxStarter script #1
# Open powershell ad administrator:
# Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1')); Get-Boxstarter -Force
# install winget https://apps.microsoft.com/store/detail/programma-di-installazione-app/9NBLGGH4NNS1?hl=it-it&gl=it&rtc=1
# Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/TheTrigger/aaf143b9e64b40d523ed9bdb47b1e53f/raw/boxstarter.ps1 -DisableReboots
# https://gist.github.com/TheTrigger/758c5fe82d73a8572eb3bc018961cd6f
Import-Module Boxstarter.Chocolatey
@TheTrigger
TheTrigger / backup.ps1
Last active January 3, 2023 14:21
Windows Lazy Backup
Set-Variable -Name "username" -Value $env:UserName
Set-Variable -Name "destination" -Value "D:\Backup\20230103"
# D:\Dropbox\Configurazioni\
$dirs = @{
"C:\Users\$username\AppData\Roaming\Sublime Text 3\Local\" = "$destination\Sublime_Text\"
"C:\Users\$username\AppData\Local\Google\Chrome\User Data\" = "$destination\GoogleProfile\"
"C:\Users\$username\AppData\Roaming\AnyDesk\" = "$destination\AnyDesk\"