Skip to content

Instantly share code, notes, and snippets.

-- ExportSQLite: SQLite export plugin for MySQL Workbench
-- Copyright (C) 2009 Thomas Henlich
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
@stylesuxx
stylesuxx / FullWindowWidthScrollArea.cpp
Last active July 1, 2019 23:13
Expand the widgets inside a scrollArea to the maximum possible size, or the window to the minimum possible size.
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QVBoxLayout>
#include <QScrollArea>
#include <QSlider>
#include <QWidget>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
@stylesuxx
stylesuxx / affiliate.js
Last active January 6, 2019 01:34
Add and/or replace URL parameters in links
(function() {
this.Affiliate = function(options) {
this.settings = {
affiliates: [],
};
function extendDefaults(source, properties) {
for(var property in properties) {
if(properties.hasOwnProperty(property)) {
source[property] = properties[property];
<div id="disqus_thread"></div>
<script>
window.addEventListener('message', receiveMessage, false);
function receiveMessage(event)
{
if (event.data) {
var msg;
try {
msg = JSON.parse(event.data);
} catch (err) {
@stylesuxx
stylesuxx / custom_module.drush.inc
Created February 23, 2018 13:13
Drupal drush template with argument and options
<?php
/**
* Implements hook_drush_command
*/
function custom_module_drush_command() {
$items['drush-command'] = array(
'description' => "This is a drush command.",
'aliases' => array('dc'),
// ==UserScript==
// @name ELR: Batch Management
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Manage a list of recipes to make in your next batch.
// @author stylesuxx@gmail.com
// @match http://e-liquid-recipes.com/*
// @grant none
// ==/UserScript==
// @require http://code.jquery.com/jquery-latest.js
module top (input btn1, output led1, output led2, output led3);
reg [2:0] cnt;
initial begin
cnt = 3'b000;
end
always @(posedge btn1) begin
if(cnt == 0)cnt = 3'b001;
else cnt = cnt << 1;
{led3, led2, led1} = cnt;
module top (input btn1, output led1);
initial begin
led1 = 0;
end
always @(posedge btn1) begin
led1 = !led1;
end
endmodule
module top (input btn1, output led1);
always @(btn1) led1 = btn1;
endmodule
# Only comment out the IO's you are using in your code
#set_io clk R9
#set_io led1 C8
#set_io led2 F7
#set_io led3 K9
#set_io btn1 K11
#set_io btn2 P13