Skip to content

Instantly share code, notes, and snippets.

View mcnemesis's full-sized avatar
💭
DNAP hackathons on days with good weather ;-)

Nemesis Fixx Da JWL mcnemesis

💭
DNAP hackathons on days with good weather ;-)
View GitHub Profile
@mems
mems / gist:5301297
Last active February 23, 2022 13:12
How to convert a (simple) SWF to PDF

Convert (simple) SWF to PDF

In SWFTools a programs called gfx2gfx is available to do this task, but it's not officially available precompiled.

It can convert SWF, PDF or image to SWF, PDF, ebook or image.

For discard downscaling for rasterized image (default: 72dpi) we use the provided by @m-p-y: add -r attribute to increase maxdpi

Requirements

@mcnemesis
mcnemesis / MainActivity.java
Last active November 2, 2020 17:09
Example Activity using the DNAP Histrion as an embed
package com.nuchwezi.nulabs;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@mcnemesis
mcnemesis / DRAMON.default.config.json
Last active July 6, 2020 08:18
Sample DRAMON Configuration
{"DRINK":["Soda","Water","Something Hot","Tea","Some Wine","Milk","Yorghurt","Beer","Spirit","Porridge","A Herb.","some Fresh Juice","Bushera","Warm Water"],"CALL":["A Girlfriend","A Relative","Your Friend","someone you miss."],"EAT":["A Fruit","Leafy Vegetables","Fish","Nuts","Something Starchy","No meat","Chicken","some Seeds"],"GO TO":["Entebbe","A Forest","The Lake","Kampala","Home","School","a dance floor.","Bed.","work. "],"Summon":["God","Guardian Angel","Allself","Certain","your muse."],"LISTEN TO":["Some Nu Music","A Podcast","Old Hip Hop","Ragga!","Jazz","Some music.","Something you can play yourself, using things around you.","Traffic"],"WATCH":["A Music Video","A Science Video","Some News","A Cartoon","A Movie","A Comedy","Nature","Your Inner World","Something Erotic","The Skies."],"READ":["from SHRINES, by JWL.","a Holy Scripture.","One of your old documents.","Poetry","A Novel","the News","the Clouds","that book. "],"RITE":["Alone","With Someone else. (No more than 5).","With Someone else. (No m
@zgohr
zgohr / admin.py
Last active April 17, 2019 10:01
Remove Tastypie from Django admin
from django.contrib import admin
from tastypie.models import ApiKey, ApiAccess
admin.site.unregister(ApiKey)
admin.site.unregister(ApiAccess)
@duncanbeevers
duncanbeevers / sc-dl-min.js
Created March 22, 2012 12:16 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(window){var i,$sound,$buttonGroup;var $sounds=$(".sound");var clientId=require("config").get("client_id");var oauthToken=require("lib/connect").getAuthToken();var conversionHelper=require("lib/helpers/conversion-helper");var $downloadButton,size;var params,downloadUrl,onSuccess;for(i=$sounds.length-1;i>=0;i--){$sound=$($sounds[i]);var soundcloudUrl="https://soundcloud.com"+($sound.find(".soundTitle__title").attr("href")||window.location.pathname);params={url:soundcloudUrl,client_id:clientId};onSuccess=function($sound){return function(data){var params={client_id:clientId};downloadUrl=require("lib/url").stringify({query:params},data.stream_url+".mp3");$buttonGroup=$($sound.find(".sound__soundActions .sc-button-group")[0]);size=$buttonGroup.find(".sc-button:first")[0].className.match(/sc-button-((?:small)|(?:medium))/)[1];$downloadButton=$('<a class="sc-button sc-button-download sc-button-icon sc-button-responsive">Download</a>').attr({title:"Download this sound ("+conversionHelper.bytesToMB(data.origi
@mcnemesis
mcnemesis / uganda_districts.txt
Created June 4, 2014 07:23
List of all current (as of 2014) Uganda's Districts - useful in forms-authoring and other tasks of your liking (source : http://www.statoids.com/uug.html)
Abim
Adjumani
Agago
Alebtong
Amolatar
Amudat
Amuria
Amuru
Apac
Arua
@justincarroll
justincarroll / bootstrap-basic-template.htm
Last active May 11, 2018 04:43
This is my personal Bootstrap 3 and Font Awesome 4 basic HTML template.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Basic Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
@MarkNenadov
MarkNenadov / ciphering_rc5.py
Created March 8, 2011 21:07
Some throwaway code I used to demonstrate the RC5 cipher with the PyCrypto library
# Sample code by Mark Nenadov.
#
# Warning, this is OLD legacy code. It hasn't been tested in semi recent versions
# of Python or PyCrypto.
#
# You may use this however you wish, but I retain no responsibility whatsoever for how
# you use it and provide it with no warranty, either.
from Crypto.Cipher import RC5
@mcnemesis
mcnemesis / history_viz.sh
Created December 28, 2012 18:55
A Bash One-liner to visualize one's command-usage based on frequencies in one's Bash History.
history | awk '{ print $2}' | sort | uniq -c | sort -n | tail -n 30 | sed -n '{s/^[ \t]*//};p' | gnuplot -p -e 'set xtics rotate out;set style data histogram;set style fill solid 1.0 border -1;plot "-" u 1:xtic(2) notitle'
@matlads
matlads / check-df-mail.pl
Created November 26, 2012 15:08
Checking disk space using Filesys::Df with Email::Simple to email warnings.
#!/usr/bin/env perl
use strict;
use warnings;
use Filesys::Df;
use Email::Simple;
use Email::Sender::Simple qw(sendmail);
my $warn_limit = 75;