Skip to content

Instantly share code, notes, and snippets.

View thexmanxyz's full-sized avatar
🐌
work work work

Andreas Kar thexmanxyz

🐌
work work work
View GitHub Profile
@amintos
amintos / compressor.java
Created July 6, 2013 20:33
Simple LZ-Like compression in Java.
/** Fast and simple text compression.
*
* This is a modified variant of LZ77:
* The algorithm inserts "marker bytes" whose bits state which
* of the following 8 symbols are actual symbols (0) or backward
* references (1). Backward references are actually two bytes, the
* first 6 bits encoding the length and the next 10 bits encoding
* the negative offset where the repetition occurred.
* The idea is related to LZO and LZJB compression.
*
@jneubauer
jneubauer / masterplugin.php
Last active February 16, 2018 20:25
Joomla! plugin that fires all possible plugin events
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
class PlgSystemMasterplug extends JPlugin
{
function onUserAuthenticate()
{
error_log('onUserAuthenticate', 0);
}
@franzenzenhofer
franzenzenhofer / hl-en-bookmarklet
Created March 14, 2019 12:22
change any google page to english language
let l = window.location;
const p = new URLSearchParams(l.search);
p.set('hl','en');
window.location.search="?"+p.toString();
//minified bookmarklet code
//javascript:let l=window.location,p=new URLSearchParams(l.search);p.set("hl","en");window.location.search="?"+p.toString();
@richstrauss
richstrauss / floating-back-to-top-button.html
Last active May 6, 2020 04:02
Floating Back to Top Button in the Corner
// http://html-tuts.com/back-to-top-button-jquery/
// Add an anchor link somewhere in your HTML page, by adding a unique class name.
// Preferably add it somewhere outside from any containers, so we can add the fixed position to our floating back to top button.
<a href="#" class="back-to-top">Back to Top</a>
// OR, if you don't have access to html source you can create the link using some jQuery.
// Make sure to add the script below above the ending of </body> tag.
// Don't forget to get jQuery library files and add it above the ending tag of </head>.
@PhilETaylor
PhilETaylor / masterplugin.php
Last active July 4, 2021 08:59 — forked from jneubauer/masterplugin.php
Joomla! plugin that fires all possible plugin events
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.log.log');
class PlgSystemMasterplug extends JPlugin
{
function onExtensionBeforeInstall(){
JLog::add(JText::_('onExtensionBeforeInstall'), JLog::WARNING);
@flexelem
flexelem / minHeap.java
Created June 8, 2014 15:32
A min heap implementation in java.
import java.util.ArrayList;
public class MinHeap {
private ArrayList<Integer> list;
public MinHeap() {
this.list = new ArrayList<Integer>();
}
@gunjanpatel
gunjanpatel / jdatabase.md
Last active November 14, 2022 12:26
Write subquery in Joomla 3 using JDatabase method.

Here is an example of how to write subquery in Joomla! 3 using JDatabase method.

<?php
// Initialize variables.
$db       = JFactory::getDbo();
$subQuery = $db->getQuery(true);
$query    = $db->getQuery(true);

// Create the base subQuery select statement.
@Air-Craft
Air-Craft / jquery.plugin-template.js
Created October 20, 2011 10:56
jQuery Plugin Design Pattern/Template Improved!
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging
/**
* A modified (improved?) version of the jQuery plugin design pattern
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details.
*
* ADVANTAGES OF EITHER FRAMEWORK:
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace
* - Ensures ability to use '$' even in compat modes
*
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@celly
celly / gist:1591cf9305734812baad
Last active February 26, 2024 10:30
Personal Deny list for Pi-Hole
#
# link: https://gist.githubusercontent.com/celly/1591cf9305734812baad/raw/
#
# Add to you /usr/local/bin/gravity.sh file under sources=
#
# samsung 'smart tv'
127.0.0.1 log-1.samsungacr.com
127.0.0.1 log-2.samsungacr.com
127.0.0.1 notice.samsungcloudsolution.com