Skip to content

Instantly share code, notes, and snippets.

View minimum-necessary-change's full-sized avatar

minimum-necessary-change

View GitHub Profile
/*
The MIT License (MIT)
Copyright (c) 2014 Ismael Celis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@minimum-necessary-change
minimum-necessary-change / bs-loaded.php
Created January 30, 2021 05:31 — forked from bryanwillis/bs-loaded.php
Bootstrap check if loaded
<!-- BOOTSTRAP JS WITH LOCAL FALLBACK-->
<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
<script> if(typeof($.fn.modal) === 'undefined') {document.write('<script src="//www.mysite.com/js/v/bootstrap-2.1.1.js"><\/script>')}</script>
<!-- BOOTSTRAP CDN FALLBACK CSS-->
<script>$(document).ready(function() {
var bodyColor = $('body').css("color"); if(bodyColor != 'rgb(51, 51, 51)') {$("head").prepend("<link rel='stylesheet' href='//www.mysite.com/css/fw/bootstrap-combined-2.1.1.css' type='text/css' media='screen'>");}
});</script>
@minimum-necessary-change
minimum-necessary-change / ddns-start
Created January 24, 2021 13:43 — forked from ql-owo-lp/ddns-start
Asus-Merlin-DuckDNS
#!/bin/sh
# register a subdomain at https://www.duckdns.org/ to get your token
# put 'hostname|token' in the 'Host Name' field under DDNS
# e.g. myhost|abcdefgh-1234-5678-9876-f71b0ed7a7fe
DDNS_HOSTNAME_FIELD=$(nvram get ddns_hostname_x)
SUBDOMAIN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $1}')
TOKEN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $2}')
IPV4=$(nvram get wan0_ipaddr)
@minimum-necessary-change
minimum-necessary-change / install_sis_graphics_on_linux.sh
Created May 1, 2020 15:25 — forked from fevangelou/install_sis_graphics_on_linux.sh
Bash script to install SiS Mirage 3+ graphics drivers on Linux
#!/bin/bash
# Bash script to install SiS Mirage 3+ graphics drivers on Linux
# Supports 671/672MX graphics cards
#
# Created in March 2019
#
# Tested on:
# - Lubuntu 18.04 (32-bit) with X.Org v1.19
# - Xubuntu 18.04 (64-bit) with X.Org v1.20
@minimum-necessary-change
minimum-necessary-change / gist:460e0b0cc40c289b38d2b85f4ce294f4
Created September 24, 2019 06:41 — forked from bhumphrey/gist:3764983
Cherry-picking from another fork
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
@minimum-necessary-change
minimum-necessary-change / fand.c
Created August 2, 2019 18:22 — forked from andreacioni/fand.c
Simple utility program for GNU/Linux systems to control a fan motor of your miniPC (UDOO,Raspberry Pi,Orange Pi,etc) through a PWM signal
/*
A Project of Andrea Cioni
Title: Fan Daemon (FanD)
Author: Andrea Cioni (andreacioni)
cioni95@gmail.com
Copyright:
Copyright (c) 2017 Andrea Cioni <cioni95@gmail.com>
@minimum-necessary-change
minimum-necessary-change / dict.c
Created July 25, 2019 13:53 — forked from kylef/dict.c
A key/value dictionary system in C
/* A key/value dict system in C */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TEST TRUE /* Comment this line out to compile without a main function (used when including into another application). */
typedef struct dict_t_struct {
char *key;
void *value;
@minimum-necessary-change
minimum-necessary-change / gpioblnk.ino
Created July 24, 2019 07:33 — forked from RickKimball/gpioblnk.ino
c++ template blink using register level gpio access
// more fun with c++ classes and templates
// http://www.stm32duino.com/viewtopic.php?f=18&t=303
class GPIOPort :
public gpio_reg_map {
public:
void high(const uint32_t pin) {
BSRR = 1 << pin;
}
void low(const uint32_t pin) {
BRR = 1 << pin;
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <sys/resource.h>
#include <sys/types.h>
typedef struct s_block* t_block;
struct s_block {
size_t size;
@minimum-necessary-change
minimum-necessary-change / high-frequency-square-wave-generator-esp8266.ino
Created April 24, 2019 07:44 — forked from Jamesits/high-frequency-square-wave-generator-esp8266.ino
High-accuracy square wave generator (up to 250KHz) based on ESP8266, with runtime adjustable frequency, PWM width and offset.
// High-accuracy square wave generator
// based on ESP8266
// with runtime adjustable frequency, PWM width and offset
// Output wave at pin 5 (configurable from 0 to 15, but not 16)
// by James Swineson <github@public.swineson.me>, 2017-10
// https://gist.github.com/Jamesits/92394675c0fe786467b26f90e95d3904
// See https://blog.swineson.me/implementation-of-6mbps-high-speed-io-on-esp8266-arduino-ide/
// for more information (article in Chinese)
// Arduino UNO version: https://gist.github.com/Jamesits/8d164818946a65d0cafcd6203e3e5049