This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Bank ID | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description no more username pass for bankid | |
// @author eivin | |
// @match https://csfe.bankid.no/* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add our Customizer content | |
*/ | |
add_action( 'customize_register', function( $wp_customize ) { | |
$wp_customize->add_setting( 'delivery_address_text', | |
array( | |
'default' => 'By default we deliver the products to the billing address. If you want the shipment delivered on a different location please select this option:', // Optional. | |
'type' => 'theme_mod', | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'backtracer' ) ) { | |
function backtracer( $die = true ) { | |
$db = debug_backtrace(); | |
echo '<pre>'; | |
foreach ( $db as $record ) { | |
echo "{$record['file']}:{$record['line']}\n"; | |
} | |
echo '</pre>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rglob($pattern, $flags = 0) { | |
// https://stackoverflow.com/questions/17160696/php-glob-scan-in-subfolders-for-a-file | |
$files = glob($pattern, $flags); | |
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { | |
$files = array_merge($files, rglob($dir.'/'.basename($pattern), $flags)); | |
} | |
return $files; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the bring shipping rates. | |
*/ | |
add_filter('bring_shipping_rates', function( $rates ) { | |
$shipping_classes = [ | |
'halvpall', | |
'pall', | |
'stein', | |
'uuni-shipping', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo'<ul>'; | |
$db = debug_backtrace(); | |
foreach ($db as $r) { | |
echo "<li>{$r['file']}:{$r['line']}</li>"; | |
} | |
die; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// return; | |
add_action('init', function() { | |
$attribute_name = 'New a'; | |
$attribute_id = 'new_a';//wc_attribute_taxonomy_id_by_name($attribute_name); | |
$attribute_slug = wc_attribute_taxonomy_name($attribute_id);//wc_attribute_taxonomy_id_by_name($attribute_name); | |
/* | |
* @type int $id Unique identifier, used to update an attribute. | |
* @type string $name Attribute name. Always required. | |
* @type string $slug Attribute alphanumeric identifier. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.serial.*; | |
Serial myPort; | |
ArrayList<Integer>[] lapTimes = new ArrayList[2]; | |
void setup() { | |
lapTimes[0] = new ArrayList<Integer>(); | |
lapTimes[1] = new ArrayList<Integer>(); | |
myPort = new Serial(this, "/dev/tty.wchusbserial1410", 9600); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suffix = '-x'; | |
var windowHeight; | |
var products = $('.animate' + suffix); | |
products.addClass('animate' + suffix); | |
var checkPosition = function () { | |
products.each(function() { | |
var elem = $(this); | |
var top_of_element = elem.offset().top; | |
var bottom_of_element = elem.offset().top + elem.outerHeight(); | |
var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mageFilename = 'public/app/Mage.php'; | |
if (!file_exists($mageFilename)) { | |
echo $mageFilename." was not found"; | |
exit; | |
} | |
require_once $mageFilename; | |
Mage::app(); |