Skip to content

Instantly share code, notes, and snippets.

View benqy's full-sized avatar
💭
(1)

刺蛇狗毒爆 benqy

💭
(1)
View GitHub Profile
@benqy
benqy / gist:fcee16570fbe0028d50d
Last active August 29, 2015 14:03
Unity 2d游戏开发学习资源整理
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>console track</title>
</head>
<body>
console status: <span id="stat"></span>
<script>
function isConsoleOpen() {
@benqy
benqy / IE.js
Created October 19, 2015 03:56 — forked from julianshapiro/IE.js
Future-Proof IE Version Detection Without User Agent Sniffing
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
@benqy
benqy / RAF.js
Created October 19, 2015 06:46 — forked from julianshapiro/RAF.js
requestAnimationFrame Polyfill
var requestAnimationFrame = window.requestAnimationFrame || (function() {
var timeLast = 0;
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
var timeCurrent = (new Date()).getTime(),
timeDelta;
/* Dynamically set the delay on a per-tick basis to more closely match 60fps. */
/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671. */
timeDelta = Math.max(0, 16 - (timeCurrent - timeLast));
@benqy
benqy / as3andjavascript.md
Last active January 4, 2016 02:29
javascript与as3交互,骑兵程序员,2014-01-22

javascript与as3交互

###写在前面的废话 公司首页的flash广告,都是由第三方制作的,脚本和flash文件都是由各个广告公司独立制作,然后在我们页面引用.这样的方式肯定不靠谱,页面脚本非常的乱,因此现在想收回脚本控制权,采用的方式是要求广告公司做出的flash素材要按要求实现接口供js调用,并且实现类似事件的机制,在广告的各个状态切换时通知页面脚本.

以前都没接触过flash,现在只好临阵磨枪,挑一些会用到的学习一下,顺便记下来.

这篇主要讲讲js和as3之间如何交互,如何实现简单的类似事件的机制.

.windows,.editor, .content,.editor-one,.container,.monaco-editor,
.monaco-scrollable-element,.monaco-editor-background,glyph-margin,.view-lines {
	background: transparent !important;
}
.bq-bg{
	height: 100%;
	width: 100%;
	position: absolute;
@benqy
benqy / ie-proxysetting.md
Last active March 3, 2020 18:07
使用程序修改系统(IE)代理设置,骑兵程序员,2014-01-22

使用程序修改系统(IE)代理设置

这是本人在做的一个前端开发调试工具(HttpMock),功能是web服务器+http日记+http代理(类似fiddler),其中的代理功能,需要在web服务启动时,自动去设置各浏览器的代理设置.

我原先是通过写注册表的方式去实现,实现方法很简单,写一个注册表文件,启动的时候自动运行一下这个注册表文件就可以.

修改代理的注册表文件的内容,proxy.reg:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]  

"MigrateProxy"=dword:00000001

私有构造函数

class Test{
  Test._();
}

定义函数成员的参数签名

@benqy
benqy / gist:7f244b1fef723d91c22b43f339c15385
Created July 2, 2021 06:45
wechat_assets_picker sample
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {

游戏melvor的个人平衡补丁

;((main) => {
  const script = document.createElement('script')
  script.textContent = `try { (${main})(); } catch (e) { console.log(e); }`
  document.body.appendChild(script).parentNode.removeChild(script)
})(() => {
  function hackSmith() {
    startSmithing = function (clicked = false) {