Skip to content

Instantly share code, notes, and snippets.

View Aaronphy's full-sized avatar
🏀
Focusing

Aaronphy Aaronphy

🏀
Focusing
View GitHub Profile
@leviyehonatan
leviyehonatan / PersistentCookieStore.kt
Last active June 1, 2024 17:20
This is a kotlin implementation of a persistent cookie store for android, using SharedPreferences and Gson for the actual persistence
internal class PersistentCookieStore(val context: Context) : CookieStore {
inner class DatedCookie(val cookie: HttpCookie, val creationDate: Date)
val SP_COOKIE_STORE = "cookieStore"
val SP_KEY_DELIMITER = "|"
val SP_KEY_DELIMITER_REGEX = "\\" + SP_KEY_DELIMITER
val cookieSharedPreferences = context.getSharedPreferences(SP_COOKIE_STORE, Context.MODE_PRIVATE)
@thekarel
thekarel / cookie.swift
Created March 4, 2016 11:43
Grab an HTTP cookie value in Swift on iOS
@girvo
girvo / BackgroundTask.h
Created March 2, 2016 06:38 — forked from liamzebedee/BackgroundTask.h
Attempts at implementing background tasks in React Native iOS
//
// BackgroundTask.h
// tomtrack
//
// Created by Liam Edwards-Playne on 13/02/2016.
//
#import "RCTBridgeModule.h"
@interface BackgroundTask : NSObject <RCTBridgeModule>
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active March 29, 2024 22:46
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@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>
@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)
- [富文本](#富文本)
@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
@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
@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 ...
<!-- 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>