Skip to content

Instantly share code, notes, and snippets.

@tenbits
tenbits / exif-date-touch.js
Last active Jul 31, 2022
nodejs script to set a file modification date from EXIF
View exif-date-touch.js
/**
* Change file modification time to the date from EXIF
*
* System Requirements:
*
* > npm install -g includejs
* > npm install -g exif
*
* Usage:
*
@tenbits
tenbits / functions.php
Created Jul 15, 2019 — forked from lukecav/functions.php
Add Global Trade Identification Numbers (GTINs) to WooCommerce products
View functions.php
/**
* Render the Global Trade Identification Number (GTIN) meta field.
*/
function woocommerce_render_gtin_field() {
$input = array(
'id' => '_gtin',
'label' => sprintf(
'<abbr title="%1$s">%2$s</abbr>',
_x( 'Global Trade Identification Number', 'field label', 'my-theme' ),
_x( 'GTIN', 'abbreviated field label', 'my-theme' )
View Ubuntu fail2ban.md
@tenbits
tenbits / Ubuntu-swap.md
Last active May 20, 2019
Ubuntu: Enable swap
View Ubuntu-swap.md
View MultiStream.cs
public class MultiStream : Stream
{
private readonly List<Stream> _streams;
public MultiStream(params Stream[] streams)
{
_streams = streams.ToList();
}
public override void Flush()
View test.html
<html>
<script>
window.onload = function() {
nativeInterface.hideSplashScreen()
}
</script>
<style>
.with-css {
pointer-events: none;
View compo-color-picker.mask
import '/bower_components/spectrum/spectrum.css';
import '/bower_components/spectrum/spectrum.js';
define ColorPickButton {
slot domInsert () {
this.$.find('.color-picker').spectrum({
cancelText: 'Abbrechen',
chooseText: 'Auswählen',
allowEmpty: true,
View gist:ec7f0155b57b2d61a6cc90ef3d5f8b49
var x = new RegExp( "/" )
console.log(x.test( "/hello" ));
var serializedRegexParser = /^\/(.+)\/(\w+)?$/
var serializedRegex = x.toString();
console.log('serializedRegex:', serializedRegex);
var matches = serializedRegexParser.exec(serializedRegex);
var [full, regexString, regexFlags] = matches;
@tenbits
tenbits / dragger.js
Created Jan 30, 2013
element dragger - simple requestAnimationFrame example
View dragger.js
window.dragger = (function() {
var requestAnimationFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
function(callback) {
return setTimeout(callback, 17);
}
})();