Skip to content

Instantly share code, notes, and snippets.

<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 / 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];
@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
example.blif: example.v
yosys -p 'synth_ice40 -blif example.blif' example.v
example.txt: example.blif example.pcf
arachne-pnr -d 8k -p example.pcf -o example.txt example.blif
example.bin: example.txt
icepack example.txt example.bin
example_sram: icoprog example.bin
# 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
#######################################################################################################################
#
# Purpose: Bash script to fix a few elements of the default Dokku script with running correctly on Debian Wheezy
# Run as root
# Author: Shirkey <dev@shirkey.me>
# License: MIT
# Tested with:
# * Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
# * v0.2.1 of Dokku installer script
#