Skip to content

Instantly share code, notes, and snippets.

View harriha's full-sized avatar

Harri Hälikkä harriha

  • Futurice
  • Helsinki, Finland
View GitHub Profile
@harriha
harriha / gist:8fb29e3e08e9d07f8fc944f5ff70bdff
Created February 2, 2017 09:19
Material-ui dependency issue
harri@FL671 MINGW64 ~/repos/tmp/material-sample (master)
$ ll
total 9.0K
drwxr-xr-x 1 harri 197610 0 Feb 2 10:50 ./
drwxr-xr-x 1 harri 197610 0 Feb 2 10:35 ../
-rw-r--r-- 1 harri 197610 275 Feb 2 10:41 package.json
harri@FL671 MINGW64 ~/repos/tmp/material-sample (master)
$ cat package.json
{
@harriha
harriha / gist:05bf241e923a1403eb88
Last active October 10, 2016 15:15
Flowdock zen mode toggle
/*
Hide Flowdock flows temporarily.
Useful for having a separate "zen mode" while keeping
the Flowdock tab open, optionally keeping only selected set of flows visible always.
My use case: when working, keep only primary project flow(s) visible and hide others,
while still allowing easy access to all flows when desired.
How-to: Add the following piece of code as a bookmarklet to your browser.
@harriha
harriha / show-wifi-passwords.ps1
Last active September 12, 2015 19:57
[Windows 8] Show passwords of Wi-Fi profiles in clear-text
(netsh wlan show profiles) | # Fetch all Wi-Fi profiles
Select-String "\:(.+)$" | # Grab the profile name (note: not necessarily equal to SSID)
%{$name=$_.Matches.Groups[1].Value.Trim(); $_} | # Store profile name to a var
%{(netsh wlan show profile name="$name" key=clear)} | # Fetch profile details with clear-text password
Select-String "Key Content\W+\:(.+)$" | # Grab the password
%{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | # Store password to a var
%{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | # Construct an object to be able to use Format-Table
Format-Table -AutoSize # Format the output
Write-Host ""
@harriha
harriha / gist:7935370
Last active December 31, 2015 04:39
Experiences with Jolla

Got the phone 2013-12-12, below some experiences. Disclaimer: I own a Nokia N9, and I'm a big fan of its swipe UI.

Bugs/problems

  • Setting up accounts (especially Google and Facebook) which had 2-factor authentication in use was an horrible experience
    • It seemed that after waiting for a while in the web view where the auth flow is happening, the web view crashed/the operation was cancelled/something else - anyway, setup flow was interrupted and I was required to start it over. Extremely irritating experience, especially since I tend to have fairly complex passwords in these services.
  • The fact that Exchange plugin doesn't show any kind of errors if auth fails is bad. But apparently this is a known bug.
  • Yandex store issues, registration didn't work since (i) phone number wasn't accepted and finally because (ii) captcha couldn't be shown because of missing network connection apparently.
  • Phone language defines automatically used number formats (e.g. units in Maps app). More fine-grained settings nee
@harriha
harriha / gist:7778849
Created December 3, 2013 22:35
IE11 bug with dynamic CSS styles

tl;dr

Adding new CSS rules as a string to 'cssText' property of a stylesheet object breaks (some) existing styles in IE11.

The broken styles include viewport adaptation via @-ms-viewport, leading to broken ("zoomed-out desktop version") responsive sites in Windows 8 style IE11 with window width less than 1024px.

Some widely used plugins (incorrectly) use this approach and can thus break your responsive site. Currently, I'm aware of only Facebook's JavaScript SDK doing this - in other words, if you use FB's plugins and include their JS SDK, your responsive site won't work in Windows 8 style IE11 as expected.

MSFT bug report

@harriha
harriha / gist:4190738
Created December 2, 2012 19:58
Collection of globals for JSHint
globals: _.extend({},
{ // Win8
WinJS: false,
Windows: false
},
{ // grunt/node
require: false
},
{ // Jasmine/chai/etc
describe: false,
@harriha
harriha / server.js
Created November 18, 2012 14:51
Share static web content with Node.js
// Save to a file server.js and 'node server.js'
var connect = require('connect');
connect.createServer(
connect.static(__dirname)
).listen(8080);
function enablePhantomLimb(scriptSrc,config){
var script=document.createElement('script');
script.src=scriptSrc;
script.type='text/javascript';
script.addEventListener('load',function(){
if('phantomLimb'in window){
phantomLimb.init(config)
}
else{
console.error('Phantom Limb could not be loaded')