Skip to content

Instantly share code, notes, and snippets.

@footearth
footearth / gist:85334c0bc325b0f241effbf164f36229
Created March 30, 2019 04:46
Dart array reduce like es6
#!/usr/bin/env dart
class Array {
var
list
, index = 0
;
Array (list) {
@footearth
footearth / atom.sh
Created April 22, 2016 16:43
Open more projects in one window
#!/usr/bin/env bash
CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
_PWD=$PWD
EDITOR='atom-beta'
# cd $CWD
dirlist=(*)
projects=()
@footearth
footearth / README.md
Last active April 22, 2016 16:44
Web 前端攻防(2014版)---- Opener 钓鱼

Opener

浏览器提供了一个 opener 属性,供弹出的窗口访问来源页。但该规范设计的并不合理,导致通过超链接打开的页面,也能使用 opener。

因此,用户点了网站里的超链接,导致原页面被打开的第三方页面控制。

虽然两者受到同源策略的限制,第三方无法访问原页面内容,但可以跳转原页面。

@footearth
footearth / README.md
Last active August 29, 2015 14:27 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for Ubuntu 14.04 & 12.04 and Debian 8 & 7

IPsec/L2TP VPN Auto Install Script for Ubuntu/Debian

Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8 & 7.

With minor modifications, this script can also be used on dedicated servers or any KVM- or XEN- based Virtual Private Server (VPS) from other providers.

For more information

My VPN tutorial with detailed usage instructions
Alternative VPN script for CentOS/RHEL

@footearth
footearth / node.py
Last active August 29, 2015 14:25
Use_python_install_node_env
#!/usr/bin/env python
import envoy
import os
import shutil
_path_ = {
'home': os.environ['HOME'],
'script': os.path.split(os.path.realpath(__file__))[0]
}

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

@footearth
footearth / ArchLinux.md
Last active August 29, 2015 14:06 — forked from v4lour/ArchLinux.md

Arch Linux安装记录

@v4lour

泡了快一个月的图书馆,单调乏味,需要找点乐子。想来想去,来折腾一下Arch Linux。花了大概三天时间安装、配置好系统及各种开发环境。因此记录几点需要注意的地方,完整的安装指南可参考此篇以及官方新手指南

安装三大步

  • 基本系统安装
  • 驱动安装
@footearth
footearth / Use_shell_manage_packages.md
Last active January 1, 2016 14:19
Use_shell_manage_packages

Use shell manage packages

npm

apm

@footearth
footearth / Nginx 反向代理配置
Last active December 28, 2015 23:18
Nginx 反向代理配置
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;