Skip to content

Instantly share code, notes, and snippets.

from lxml import html
import requests
import datetime
def getOwnersLinks(url):
page = requests.get(url)
tree = html.fromstring(page.content)
houseOwners = tree.xpath('//tr/td/a')
houseLinks = []
for house in houseOwners:
package ui;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
{"Recipe":{"Name":"Repair Kit","CraftTable":"Blacksmithing","NPCValue":50},"Ingredients":[{"Quantity":2,"Name":"Leather","Cost":0},{"Quantity":2,"Name":"Copper or Iron Ingot","Cost":0},{"Quantity":1,"Name":"Smithing Hammer","Cost":1}]}
public class HookIntent implements IXposedHookLoadPackage {
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("android.app.Activity"))
return;
findAndHookMethod("android.app.Activity", lpparam.classLoader, "getIntent", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
// mIntent is the variable that will return
// should use it to get Extra
package com.enew.timetracker.database;
public interface BaseTable {
public String getColumnID();
public String getTable();
public String[] getColumns();
}
package com.caioketo.owrpg;
/**
* Created by Caio on 31/10/2014.
*/
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
public abstract class BaseActivity extends ActionBarActivity {
@caioketo
caioketo / gist:7354455
Created November 7, 2013 13:19
Image processing
string path = @"C:\AC\test.png";
Bitmap image = (Bitmap)Bitmap.FromFile(path);
Grayscale filter = new Grayscale(0.2125, 0.7154, 0.0721);
// apply the filter
image = filter.Apply(image);
image.Save("result0.png");
DifferenceEdgeDetector filter1 = new DifferenceEdgeDetector();
// apply the filter
filter1.ApplyInPlace(image);
image.Save("result1.png");
var cubeMaterialArray = [];
cubeMaterialArray.push(new THREE.MeshBasicMaterial({ color: 0xff3333 }));
cubeMaterialArray.push(new THREE.MeshBasicMaterial({ color: 0xff8800 }));
cubeMaterialArray.push(new THREE.MeshBasicMaterial({ color: 0xffff33 }));
cubeMaterialArray.push(new THREE.MeshBasicMaterial({ color: 0x33ff33 }));
cubeMaterialArray.push(new THREE.MeshBasicMaterial({ color: 0x3333ff }));
cubeMaterialArray.push(new THREE.MeshBasicMaterial({ color: 0x8833ff }));
var cubeMaterials = new THREE.MeshFaceMaterial(cubeMaterialArray);
var wall = new THREE.Mesh(new THREE.CubeGeometry(5, 45, 100, 1, 1, 1), materials);
var wall2 = new THREE.Mesh(new THREE.CubeGeometry(5, 30, 100, 1, 1, 1), materials);
@caioketo
caioketo / gist:6554400
Created September 13, 2013 18:37
setting unifroms
new THREE.MeshShaderMaterial({
uniforms: {
sky_texture: { type: 't', value: 0, texture: textures.sky },
hidden: this.hidden,
time: window.map.time_uniform,
},
attributes: {
heightmap: { type: 'f', value: [] }
},
vertexShader: document.getElementById( 'waterVertexShader' ).textContent,
@caioketo
caioketo / gist:6554375
Created September 13, 2013 18:35
GLSL hidden
uniform sampler2D sky_texture;
uniform int hidden;
uniform float time;
varying vec2 vUv;
varying vec3 vPosition;
varying float vHeightmap;
void main()