Skip to content

Instantly share code, notes, and snippets.

I am attesting that this GitHub handle purespider is linked to the Tezos account tz1PqooZUtCQqP539PmMzUWHtaUX6EQtFY5S for tzprofiles
sig:edsigtZYJxdT8hLKxKxrKgEFDsj2NRddAdEGWMAmA5QKaqUDwqntHYLuy1fYkAW4PbGVvHt4fMvVi53uEtEYtsmm5tdHCBgFCfG
@PureSpider
PureSpider / MetallurgyChiselFix.zs
Last active February 11, 2017 09:53 — forked from AeroyrHwrdd/MetallurgyChiselFix.zs
Minetweaker 3/Modtweaker zen script fix for Metallurgy chisel block clash
// Fix Metallurgy Chisel groups for blocks that have regular chisel blocks as well
mods.chisel.Groups.removeGroup("copper_block");
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_circle_plate:0>);
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_quarter_plate:0>);
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_horizontal_plate:0>);
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_small_bricks:0>);
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_horizontal_pipes:0>);
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_plate:0>);
mods.chisel.Groups.addVariation("copperblock", <metallurgychisel:base_blank_plate:0>);
/*
* SPI testing utility (using spidev driver)
*
* Copyright (c) 2007 MontaVista Software, Inc.
* Copyright (c) 2007 Anton Vorontsov <avorontsov@ru.mvista.com>
*
* 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 2 of the License.
*
@PureSpider
PureSpider / gist:6901156
Created October 9, 2013 13:19
Resize image to new width and height.
public Bitmap resizeBitmap(Bitmap in, float newWidth, float newHeight) {
// http://forrst.com/posts/Bitmap_Drawable_Resize_on_Android-mjr
Bitmap bitmapOrig = in;
DisplayMetrics metrics = new DisplayMetrics();
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
windowManager.getDefaultDisplay().getMetrics(metrics);
float logicalDensity = metrics.density;
@PureSpider
PureSpider / gist:6901020
Created October 9, 2013 13:10
Resizes the Bitmap (can also be a Drawable with minor changes) to 32dip and masks and draws the checkmark
public Bitmap drawCheck(Bitmap in) {
// http://forrst.com/posts/Bitmap_Drawable_Resize_on_Android-mjr
// http://stackoverflow.com/questions/14801075/android-how-to-apply-mask-on-imageview
float newWidth = 32;
float newHeight = 32;
Bitmap bitmapOrig = in;
DisplayMetrics metrics = new DisplayMetrics();
function loadURL(url) {
$.get("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%27" +
encodeURIComponent(url) +
"%27%0A&format=xml&diagnostics=false",
function(data){
var xml = $( data );
var body = xml.find("query results body");
// ...
}
);
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pi.shade.mobileapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />