Skip to content

Instantly share code, notes, and snippets.

var gamelib = {audio: {}, dom: {}, input: {}, tween: {}};
gamelib.hitTest1x1 = function (gameObject1, gameObject2) {
if (!gameObject1.alive || !gameObject2.alive) {
return
}
if (gameObject1.aabb.x0 > gameObject2.aabb.x1 || gameObject2.aabb.x0 > gameObject1.aabb.x1 || gameObject1.aabb.y0 > gameObject2.aabb.y1 || gameObject2.aabb.y0 > gameObject1.aabb.y1) {
return
}
gameObject1.onCollide(gameObject2);
gameObject2.onCollide(gameObject1)
@shuidong
shuidong / TweetListBackupsheets
Created August 15, 2012 12:13 — forked from johannesnagl/Tweetsheets
Use Twitter directly in your Google Doc, so no one will ever blame you for being social(backup the tweets of list)
var CONSUMER_KEY = "<< YOUR KEY HERE >>";
var CONSUMER_SECRET = "<< YOUR SECRET HERE >>";
var OWNER_SCREEN_NAME = "<< YOUR LIST OWNER'S NAME HERE >>";
var SLUG = "<< YOUR LIST NAME HERE >>";
//Then fill the 235682008200790016 into E1
function getConsumerKey() {
return CONSUMER_KEY;
@shuidong
shuidong / curveWriter.html
Last active February 21, 2018 03:32
繁花曲线简易模拟
<html>
<head>
<meta charset="utf-8">
<title>繁花</title>
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@shuidong
shuidong / gist:cc8144c611937d94733c2a55e96f5184
Last active February 15, 2019 01:27
自动登录readfree
var https = require("https");
var querystring = require("querystring");
var options = {
host: "readfree.me",
path: "/auth/login/",
method: "get",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
@shuidong
shuidong / socks-proxy.md
Created May 5, 2019 11:49 — forked from holmberd/socks-proxy.md
Configure remote SSH service and set up local SSH SOCKS proxy tunnel

REMOTE: Set up SSH service on the remote host

  • Skip if already set up, check with: sudo service ssh status
  • sudo apt-get install ssh
  • Edit ssh config file with the lines below: sudo vim /etc/ssh/sshd_config
PermitRootLogin no              #Disable direct login from root
AllowUsers user1 user2 user3    #*Only* allow this users to connect
AllowTcpForwarding yes          #Required to setup the tunnel, yes or commented out
PubkeyAuthentication yes        #Enables public key authentication
Port 22                         #Listening port of the server
@shuidong
shuidong / JavaScript.md
Created July 20, 2020 09:48 — forked from kenmori/JavaScript.md
JavaScript練習問題集(ECMAScript2015,2016,2017,2018,2019,2020,other Library)

JavaScript練習問題集

JavaScript

更新情報

・Decoratorsに関する問題を追加(2020/6/6)
・リンクを追加(2020/5/30)
・問題を追加(2020/4/18)
@shuidong
shuidong / Purchaser.cs
Created December 21, 2020 05:50 — forked from YoshihideSogawa/Purchaser.cs
UnityIAPでハマりながら作ったクラス
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
/// <summary>
/// 課金処理を扱うクラスです。
/// 非消費、サブスクリプション型は動作未検証です。
/// Android/iOSのみ動作検証しています。
/// INFO:[iOS]未購入のアイテムがあるとInitialize後すぐに認証ダイアログが表示されるので、呼び出すタイミングを調整してください
#!/bin/bash
echo "$@" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|'