Skip to content

Instantly share code, notes, and snippets.

rosmo /
Created January 12, 2022 21:54
TP-Link X90 Deco API example
from requests.api import request
from Crypto.Cipher import PKCS1_OAEP, PKCS1_v1_5
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Util.Padding import pad
from Crypto.Util.number import bytes_to_long
import base64
import requests
import string
import random
RicardoBelchior /
Last active December 8, 2017 21:32 — forked from deepankarb/
A script to generate android assets from a SVG file. Requires inkscape to resize and convert.
USAGE="Usage is: ./ <svg_file> <exported_png_name> <width_dp> <height_dp> [resources_dir] \n \
If 'resources_dir' is ommited, a new folder is created in the current directory, named after the svg name.\n \
Param 'exported_png_name' does not need extension.\n \
On Mac OS specify full path for svg file and resources directory.\n \
if [[ -z "$1" ]];
deepankarb /
Last active July 14, 2018 13:13
A script to generate android assets from a SVG file. Requires inkscape to resize and convert.
if [[ -z "$1" ]];
echo "No SVG file specified. Exiting."
exit -1
ispng=$(file $1)
echo $ispng | grep -q SVG
komiya-atsushi /
Created April 13, 2013 06:13
Twitter4J で Application-only authentication の bearer トークンを用いて Twitter API を呼び出す ref:
package demo.twitter4j;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.Authorization;
import twitter4j.conf.ConfigurationBuilder;
import twitter4j.internal.http.HttpRequest;
JakeWharton /
Created June 2, 2012 02:14
ImageView that respects an aspect ratio applied to a specific measurement.
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {