Skip to content

Instantly share code, notes, and snippets.

@FFY00
FFY00 / issue
Created July 3, 2018 20:18
/etc/issue
___-------- '
_ / /________'
/XX( / \ )XXXXXXXXXXX\'
/XXX( O O )XXXXXXXXXXXXXXX\'
/XXX( U ) XXXXXXX\'
/XXXXX( ) XXXXXXXXXXX\'
/XXXXX/ ( O )__ XXXXXX \XXXXX\'
|XXXXX/ / XXXXXX \__ \XXXXX|'
|XXXXXX__/ XXXXXX \______-----'
--___ |XXX__/ XXXXXX \__ /'
@ryansechrest
ryansechrest / php-style-guide.md
Last active December 27, 2024 05:27
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@vwbusguy
vwbusguy / auto-profile-update.sh
Last active December 27, 2024 05:24
Auto Update for power-profiles-daemon
#!/bin/bash
dbus-monitor --system "type='signal',path='/org/freedesktop/UPower/devices/battery_BAT0',member='PropertiesChanged'" | while read LINE; do
echo ${LINE} | grep battery_BAT0 | grep -q PropertiesChanged
if [ $? -eq 0 ]; then
BATT_STAT=$(dbus-send --print-reply=literal --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT0 org.freedesktop.DBus.Properties.Get string:org.freedesktop.UPower.Device string:State | awk '{ print $3; }')
if [ $BATT_STAT -eq 1 ] || [ $BATT_STAT -eq 4 ]; then
LEVEL=$(powerprofilesctl list | grep -q performance && echo "performance" || echo "balanced")
elif [ $BATT_STAT -eq 5 ]; then
LEVEL="balanced"
@Moyf
Moyf / LiteDatabase-en.js
Last active December 27, 2024 05:19
DVJS Code - Lite Database for Obsidian
const useList = false;
const curNote = dv.current();
if (!curNote){
dv.span("The current document is not loaded, please reopen it.");
return;
}
let tarFile = await app.vault.getAbstractFileByPath(curNote.file.path);
// Get the meta data of the current file
const curFileMeta = app.metadataCache.getFileCache(tarFile);
const headings = curFileMeta.headings;
@sam016
sam016 / AllGattCharacteristics.java
Last active December 27, 2024 05:17
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@raipradeep
raipradeep / Line Graph
Created December 27, 2024 05:12
Line Chart With Canvas In Jetpack Compose
@Composable
fun LineChart(
labelsXAxis: List<String>,
dataPointsYAxis: List<Float>,
modifier: Modifier = Modifier,
textColor: Color = AppTheme.Dark,
axisSpacing: Float = 60f,
maxDataPoints: Int = 35// Count for X Axis Data
) {
@yifanzz
yifanzz / code-editor-rules.md
Created December 17, 2024 00:01
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
@DerFichtl
DerFichtl / tampermonkey-adblock-block.md
Last active December 27, 2024 05:07
Tampermonkey Adblock Script - This Ad-Blocker is running on pages with Adblock-detectors and can remove or click elements to cleanup before you start browsing.
layout title published tags
post
Tampermonkey ad-blocker
true
adblock
tampermonkey
browser

This ad-blocker script for Tampermonkey won't trigger an adblock-block / adblock-detector script and so you could use it for pages that are annoying you with "please turn of your adblock" messages. It's just hiding the ads and don't try to intercept the requests or remove the ads at all. So it don't make the websites faster, but it makes them cleaner and easier to read.

This script is not a generic solution and has to be configured for every website it should clean up. I don't provide configs for pages, just use your browser developer-tools to find the elements you want remove or click.

@Firepup6500
Firepup6500 / mf-adblock.js
Last active December 27, 2024 05:07
mf-adblock 0.7: A Tamper Monkey Adblocker
// ==UserScript==
// @name mf-adblock
// @namespace none
// @version 0.7
// @description A basic anti-adblock workaround that can remove or click elements on a website
// @author DerFichtl, with major improvements by Firepup650
// @match https://*/*
// @icon https://getadblock.com/favicon.ico
// @grant none
// @noframes