Skip to content

Instantly share code, notes, and snippets.

View Aaronphy's full-sized avatar
🏀
Focusing

Aaronphy Aaronphy

🏀
Focusing
View GitHub Profile
@jed
jed / bookmarklet.js
Created April 28, 2011 08:57
dom tree caching performance: array v. linked list. see also: http://jsperf.com/dom-trees/
javascript:with(document)(body.appendChild(createElement('script')).src='https://gist.github.com/raw/946036/8b51f04a6f9dbe15f5c375ac872a9ae56d4b8732/domTrees.js')._
@h3xx
h3xx / wiki-100k.txt
Created March 5, 2012 03:07
Wictionary top 100,000 most frequently-used English words [for john the ripper]
#!comment: This is a list of the top 100,000 most frequently-used English words
#!comment: according to Wiktionary.
#!comment:
#!comment: It was compiled in August 2005 and coalesced into a handy list for
#!comment: use in John the Ripper.
#!comment:
#!comment:
#!comment: Pull date: Sun Jan 15 22:03:54 2012 GMT
#!comment:
#!comment: Sources:
@cobyism
cobyism / gh-pages-deploy.md
Last active June 5, 2024 21:48
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@CiTuX
CiTuX / bottom_stroke.xml
Last active June 21, 2023 03:51
Android xml drawable with a bottom stroke
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="-6dp"
android:left="-6dp"
android:right="-6dp"
android:bottom="0dp">
<shape android:shape="rectangle">
<solid android:color="#88FFFF00"/>
<!-- Video element (live stream) -->
<label>Video Stream</label>
<video autoplay id="video" width="640" height="480"></video>
<!-- Canvas element (screenshot) -->
<label>Screenshot (base 64 dataURL)</label>
<canvas id="canvas" width="640" height="480"></canvas>
<!-- Capture button -->
<button id="capture-btn">Capture!</button>
@szalishchuk
szalishchuk / ip.js
Last active December 14, 2022 11:04
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@franmontiel
franmontiel / PersistentCookieStore.java
Last active April 1, 2024 05:40
A persistent CookieStore implementation for use in Android with HTTPUrlConnection or OkHttp 2. -- For a OkHttp 3 persistent CookieJar implementation you can use this library: https://github.com/franmontiel/PersistentCookieJar
/*
* Copyright (c) 2015 Fran Montiel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@paulbbauer
paulbbauer / main.js
Last active February 8, 2024 10:42
Electron oAuth Authentication with GitHub API
// based on:
// http://iamemmanouil.com/blog/electron-oauth-with-github/
// https://github.com/ekonstantinidis/gitify
// this version uses https rather than superagent
var querystring = require('querystring');
var https = require("https");
// Your GitHub Applications Credentials
@huang5556019
huang5556019 / 自己总结的iOS、mac开源项目及库
Created September 18, 2015 07:28
自己总结的iOS、mac开源项目及库
# TimLiu-iOS
========
自己总结的iOS、mac开源项目及库。 github排名 [https://github.com/trending](https://github.com/trending),github搜索:[https://github.com/search](https://github.com/search)
### 目录
- [UI](#UI)
- [下拉刷新](#下拉刷新)
- [模糊效果](#模糊效果)
- [AutoLayout](#AutoLayout)
- [富文本](#富文本)
@ufologist
ufologist / autoplay-audio-ios.html
Created December 3, 2015 03:55
在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Auto play html audio in iOS WeChat InAppBrowser the right way</title>
</head>
<body>
<h1>在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式</h1>
<p>核心原理: 在微信的JS-API 中 play 一下 audio 即可达到自动播放的目的(应该是微信自己做了处理)</p>