Skip to content

Instantly share code, notes, and snippets.

View gunta's full-sized avatar
🎯
Focusing on UX for AI

Gunther Brunner gunta

🎯
Focusing on UX for AI
  • CyberAgent Co., Ltd
  • Tokyo, Japan
View GitHub Profile
@burin
burin / gist:3840737
Created October 5, 2012 16:06
Full screen web app in iPhone 5 (save to home screen)
<!-- standard viewport tag to set the viewport to the device's width
, Android 2.3 devices need this so 100% width works properly and
doesn't allow children to blow up the viewport width-->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<!-- width=device-width causes the iPhone 5 to letterbox the app, so
we want to exclude it for iPhone 5 to allow full screen apps -->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
<!-- provide the splash screens for iPhone 5 and previous -->
<link href="assets/splashs/splash_1096.png" rel="apple-touch-startup-image" media="(device-height: 568px)">
<link href="assets/splashs/splash_iphone_2x.png" rel="apple-touch-startup-image" sizes="640x960" media="(device-height: 480px)">
@desandro
desandro / jquery-layout-review.md
Created January 28, 2013 18:13
layout thrashing in jQuery
@zerosignalproductions
zerosignalproductions / throttleresize.js
Last active January 6, 2017 19:33
JS Throttled Resize event using requestAnimationFrame
/**
* Throttled Resize event
* Updated to use requestAnimationFrame instead of setTimeout
* Original: https://github.com/louisremi/jquery-smartresize
*/
var $specialThrottle,
dummy = {_:0},
frame = 0,
wasResized,
@skyrocknroll
skyrocknroll / redis-install.sh
Last active July 18, 2017 20:54
redis installation fedora redhat centos yum ami amazon
#!/bin/bash
# From here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# Based on: https://github.com/saxenap/install-redis-amazon-linux-centos
# Thanks to https://raw.github.com/gist/2776679/b4f5f5ff85bddfa9e07664de4e8ccf0e115e7b83/install-redis.sh
# Uses redis-server init script from https://raw.github.com/saxenap/install-redis-amazon-linux-centos/master/redis-server
###############################################
# To use:
## wget https://raw.github.com/jorgerc/install-redis-amazon-linux-centos/master/redis-install-script.sh
## chmod 777 redis-install-script.sh
## ./redis-install-script.sh
@nelsonpecora
nelsonpecora / autofillDirective.js
Last active December 31, 2015 06:19
Hacky directive that "fixes" autofill
// autofill catcher (super hacky, abandon all hope ye who enter here --np)
app.directive('autofill', ['$timeout', function($timeout) {
return {
restrict: 'A',
require: 'ngModel',
link: function( scope, elem, attrs ) {
var ownInput = false;
// trigger an input 500ms after loading the page (fixes chrome and safari autofill)
$timeout(function() {
var $compileCache = function ($http, $templateCache, $compile) {
var cache = {};
return function (src, scope, cloneAttachFn) {
var compileFn = cache[src];
if (compileFn) {
compileFn(scope, cloneAttachFn);
} else {
$http.get(src, { cache: $templateCache }).success(function (response) {
var responseContents = angular.element('<div></div>').html(response).contents();

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@leipert
leipert / detectBrowserLanguage.js
Last active March 11, 2024 02:10 — forked from anonymous/detectBrowserLanguage.js
Detect browser language in javascript (utilizing lodash)
// These window.navigator contain language information
// 1. languages -> Array of preferred languages (eg ["en-US", "zh-CN", "ja-JP"]) Firefox^32, Chrome^32
// 2. language -> Preferred language as String (eg "en-US") Firefox^5, IE^11, Safari,
// Chrome sends Browser UI language
// 3. browserLanguage -> UI Language of IE
// 4. userLanguage -> Language of Windows Regional Options
// 5. systemLanguage -> UI Language of Windows
var browserLanguagePropertyKeys = ['languages', 'language', 'browserLanguage', 'userLanguage', 'systemLanguage'];
@voluntas
voluntas / webrtc.rst
Last active May 21, 2024 13:55
WebRTC の未来

On Twitter the other day, I was lamenting the state of OCSP stapling support on Linux servers, and got asked by several people to write-up what I think the requirements are for OCSP stapling support.

  1. Support for keeping a long-lived (disk) cache of OCSP responses.

    This should be fairly simple. Any restarting of the service shouldn't blow away previous responses that were obtained. This doesn't need to be disk, just stable - and disk is an easy stable storage for most server