Skip to content

Instantly share code, notes, and snippets.

View motoy3d's full-sized avatar

Motoi Kataoka motoy3d

View GitHub Profile
@zeuxisoo
zeuxisoo / app.js
Created June 9, 2011 04:15
Titanium mobile parse html
Ti.include('lib/htmlparser.js');
Ti.include('lib/soupselect.js');
var select = soupselect.select;
var body = '<html><head><title>Test</title></head>'
+ '<body>'
+ '<img src="http://l.yimg.com/mq/i/home/HKGallery.gif" />'
+ '<div id="block">'
+ ' <div class="row">Row 1</div>'
@oroce
oroce / _for iOS users
Created November 2, 2011 18:20
Appcelerator share to native facebook, twitter
This gist is only for Android.
If you would like launch native apps
on iPhone, iPad, you can find information about it in Appcelerator Docs:
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html
More info about iOS URL Schemes: http://handleopenurl.com/
@skypanther
skypanther / app.js
Created December 2, 2011 19:49
Titanium Mobile helper module for determining whether you're on a tablet or phone
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
package com.yokogoshi.line_intent_test;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
@MotiurRahman
MotiurRahman / app.js
Last active August 6, 2017 12:37
How to delete cache file in webView
/*When we load any website site in webView it generate some cache file also in the app cacheDirectory we
can delete this easily, here is the sample code*/
var win = Ti.UI.createWindow({
layout : 'vertical',
exitOnClose : true
});
var delBtn = Ti.UI.createButton({
top : 10,
@kawasima
kawasima / SafeResolver.java
Last active October 3, 2020 02:40
Struts1 S2-020対応
/**
* A Resolver that doesn't call getClass().
*
* @author kawasima
*/
public class SafeResolver extends DefaultResolver {
private static final char NESTED = '.';
private static final char MAPPED_START = '(';
private static final char MAPPED_END = ')';
private static final char INDEXED_START = '[';
package example;
import org.apache.commons.beanutils.expression.DefaultResolver;
public class SafeResolver extends DefaultResolver {
@Override
public String next(String expression) {
String property = super.next(expression);
if ("class".equalsIgnoreCase(property)) {
@lbrenman
lbrenman / index.js
Last active September 3, 2021 22:36
Titanium Local Notifications Example
function doClick(e) {
alert($.label.text);
}
$.index.open();
var alertFields = {
title: 'Notification', //Android Only
body : 'Just another notification',
badge: 1,
<?php
/**
* Assumes https://github.com/Spomky-Labs/jose library is installed and autoloading is set up
* Decode and verify token guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Verify.md
*/
use Jose\Factory\JWKFactory;
use Jose\Loader;
// We load the key set from a URL
// JSON Key URL (JKU) - https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json.
@prog893
prog893 / README.md
Last active August 6, 2024 00:45
CloudFront Signed Cookie generator in Python

CloudFront Signed Cookie generator

For signed URLs, refer here

Usage

from cloudfront_signed_url import generate_cloudfront_signed_url

url = "https://your-cf-domain.com/path/to/file.txt"
cookie = generate_cloudfront_signed_cookie(url, 3600)