Skip to content

Instantly share code, notes, and snippets.

Avatar
🐌
work work work

Andreas Kar thexmanxyz

🐌
work work work
View GitHub Profile
@franzenzenhofer
franzenzenhofer / hl-en-bookmarklet
Created Mar 14, 2019
change any google page to english language
View hl-en-bookmarklet
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
Floating Back to Top Button in the Corner
View floating-back-to-top-button.html
// 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>.
@celly
celly / gist:1591cf9305734812baad
Last active May 23, 2020
Personal Deny list for Pi-Hole
View gist:1591cf9305734812baad
#
# 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
@PhilETaylor
PhilETaylor / masterplugin.php
Last active Mar 28, 2019 — forked from jneubauer/masterplugin.php
Joomla! plugin that fires all possible plugin events
View masterplugin.php
<?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);
@jneubauer
jneubauer / masterplugin.php
Last active Feb 16, 2018
Joomla! plugin that fires all possible plugin events
View masterplugin.php
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
class PlgSystemMasterplug extends JPlugin
{
function onUserAuthenticate()
{
error_log('onUserAuthenticate', 0);
}
@flexelem
flexelem / minHeap.java
Created Jun 8, 2014
A min heap implementation in java.
View minHeap.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 Nov 28, 2019
Write subquery in Joomla 3 using JDatabase method.
View jdatabase.md

Here is an example of 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.
@amintos
amintos / compressor.java
Created Jul 6, 2013
Simple LZ-Like compression in Java.
View compressor.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.
*
@Air-Craft
Air-Craft / jquery.plugin-template.js
Created Oct 20, 2011
jQuery Plugin Design Pattern/Template Improved!
View jquery.plugin-template.js
// 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
Useful scss mixins (rounded corners, gradients, text-field, button)
View _mixins.scss
@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;
}