Skip to content

Instantly share code, notes, and snippets.

@lustremedia
lustremedia / jquery plugin starter
Last active June 17, 2023 13:28
jquery plugin starter
// jQuery Plugin Boilerplate
// A boilerplate for jumpstarting jQuery plugins development
// version 1.1, May 14th, 2011
// by Stefan Gabos
// remember to change every instance of "pluginName" to the name of your plugin!
(function($) {
// here we go!
$.pluginName = function(element, options) {
@lustremedia
lustremedia / simple-vue-apollo-subscription.vue
Created May 26, 2020 15:24 — forked from gorbypark/simple-vue-apollo-subscription.vue
A simple vue-apollo subscription example
<!--
This is a simple vue single file component example of using a subscription with vue-apollo.
This starts out as a query, and then if there are any changes to the underlying data,
the subscription updates it. The subscription works by holding open a websocket connection
to the GraphQL server. This was tested using Hasura.io and PostgreSQL, but should work with
any GraphQL implementation that supports websocket subscriptions. In the example, the
PostgreSQL table would be in a schema named "myschema" and a table named
"mytable" and that table would have two columns, "id" and "name".
-->
Copied from https://www.pantz.org/software/mysql/mysqlcommands.html
This is a list of handy MySQL commands that I use time and time again. At the bottom are statements, clauses, and functions you can use in MySQL. Below that are PHP and Perl API functions you can use to interface with MySQL. To use those you will need to build PHP with MySQL functionality. To use MySQL with Perl you will need to use the Perl modules DBI and DBD::mysql.
Below when you see # it means from the unix shell. When you see mysql> it means from a MySQL prompt after logging into MySQL.
To login (from unix shell) use -h only if needed.
# [mysql dir]/bin/mysql -h hostname -u root -p
Create a database on the sql server.
@lustremedia
lustremedia / unob_spiegelplus.user.js
Created February 7, 2018 09:51 — forked from trent2/unob_spiegelplus.user.js
Unobfuscate SPIEGEL plus articles with greasemonkey
// ==UserScript==
// @name unobfuscate spiegel plus
// @namespace obfuscate
// @include http://www.spiegel.de/*
// @version 1
// @grant none
// ==/UserScript==
if(document.getElementsByClassName('obfuscated-content')[0] != undefined) {
document.getElementsByClassName('obfuscated-content')[0].setAttribute("class", "");
var elems = document.getElementsByClassName('obfuscated'), t, or, c, i, cc;
@lustremedia
lustremedia / tint2-default-cb
Created January 21, 2014 20:33
Default tint2 config from CrunchBang Waldorf
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://crunchbanglinux.org/forums/topic/3232/my-tint2-config/
# Background definitions
@lustremedia
lustremedia / wordpress-change-domain-migration.sql
Created October 9, 2017 07:43 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
@lustremedia
lustremedia / bootstrap.min.css
Last active December 30, 2015 16:08
newspaper hmtl and css
/*!
* Bootstrap v3.0.3
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
function feedFilter($query) {
if ($query->is_feed) {
add_filter('rss2_item', 'feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
function feedContentFilter($item) {