Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am TyIsI on github.
  • I am TyIsI (https://keybase.io/TyIsI) on keybase.
  • I have a public key whose fingerprint is 87D2 86E6 DA93 4F2B EEA9 96ED 73ED B6D8 E372 7203

To claim this, I am signing this object:

@TyIsI
TyIsI / gist:a23616cf0b655e4447e9
Created January 29, 2015 13:30
ghost-test.sh
#!/bin/sh
mkdir ghost-tmp
cd ghost-tmp
cat > GHOST.c << EOF
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@TyIsI
TyIsI / dynamic-loading-and-calling.js
Last active May 5, 2016 22:04
Javascript dynamic class loading and dynamic method loading
// Example class
function ExampleClass() {
// Example Method
this.ExampleMethod = function ( args ) {
// Log to console
return console.log( "Name: " + args.message );
}
}
@TyIsI
TyIsI / sso_login_discourse.php
Created December 2, 2016 23:09 — forked from paxmanchris/sso_login_discourse.php
Discourse sso provider login
<?php
require('mysql.php'); // see https://gist.github.com/paxmanchris/f5d4b94f67a8acd8cefc
$me = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$sso_secret = 'YOUR_SSO_PROVIDER_KEY_HERE';
$discourse_url = 'http://example.com';
if(!empty($_GET) and isset($_GET['sso'])){
@TyIsI
TyIsI / make-vcv-modules.sh
Created December 12, 2017 20:24
Automatic make script for VCV modules. Assumes current directory is 'plugins'.
#!/bin/bash
set $modules=\
https://github.com/Aepelzen/AepelzensModules.git \
https://github.com/adbrant/ArableInstruments.git \
https://github.com/antoniograzioli/Autodafe-Drums.git \
https://github.com/antoniograzioli/Autodafe-Drums.git \
https://github.com/antoniograzioli/Autodafe.git \
https://github.com/av500/vcvrackplugins_av500.git \
https://github.com/sebastien-bouffier/Bidoo.git \
https://github.com/bogaudio/BogaudioModules.git \
@TyIsI
TyIsI / docker-install.sh
Last active August 22, 2023 15:50
Install script to install Docker and Docker Compose based on the instructions from the website
#!/bin/sh
echo "Running initial update..." \
&& sudo apt update \
&& echo "Running system upgrades..." \
&& sudo apt upgrade -y \
&& echo "Installing dependencies..." \
&& sudo apt install -y \
apt-transport-https \
ca-certificates \
@TyIsI
TyIsI / Conditional.js
Created February 6, 2021 06:54
React Conditional Wrapper Component
import React, { Component } from 'react'
class Conditional extends Component {
render () {
if (this.props.condition === false)
return null
return (
<>
{this.props.children}
@TyIsI
TyIsI / generate-ubuntu-mirrors-list.sh
Last active March 31, 2022 19:13
A script to generate an APT mirrors.list file from the official ubuntu mirrors list.
#!/bin/bash
NETSELECT_VERSION="0.3.ds1-29"
echo -n "Checking netselect installation status..." >/dev/stderr
INSTALLED=$(dpkg --list | egrep -iw netselect | egrep '^ii')
if [ "${INSTALLED}" != "" ]; then
echo "INSTALLED!" >/dev/stderr
else
@TyIsI
TyIsI / compose-check.py
Created May 24, 2022 07:34 — forked from laundmo/compose-check.py
Check which docker-compose services were changed since last "up" and which containers need to be restarted
#!/usr/bin/env python3
# This code is available under the MIT license: https://opensource.org/licenses/MIT
from pathlib import Path
import subprocess
import json
from dataclasses import dataclass
from typing import List, Optional
@TyIsI
TyIsI / open-broken-files.sh
Last active December 23, 2022 01:20
Open all the broken files!
#!/bin/bash
TMPFILE=$(mktemp)
TMPFORMATTER=$(mktemp)
{
echo 'module.exports = (results) => {'
echo ' return results'
echo ' .filter(result => result.messages.length > 0)'
echo " .map(result => \`\${result.messages.length}\\t\${result.filePath.replace(/.*(src\/.*)/, '\$1')}\`).join('\\n')"