Skip to content

Instantly share code, notes, and snippets.

Johan Forssell johanforssell

  • RealSprint AB
  • Sweden
Block or report user

Report or block johanforssell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
View react native android

I'm writing new versions of old apps, and thus I have inherited old app id's. In order to install AND RUN a flavor I need to do stuff manually. react-native run-android --variant appAAADebug does manage to get the app runnning (only installed)


My code have the package com.common.package (in source files and AndroidManifest.xml).

My build.gradle contains

johanforssell / .Xmodmap
Last active Jun 7, 2018
CapsLock = windows key & left windows key = disabled
View .Xmodmap
! Save as ~/.Xmodmap. Reload any changes with `xmodmap ~/.Xmodmap`
! Caps lock key is now the Windows (Super) key
! Left windows key is disabled
clear lock
remove mod4 = Super_L
keycode 66 = Super_L
keycode 133 =
johanforssell /
Created Feb 19, 2018
Slå av cursor-animationerna i Office 2016
johanforssell /
Created Feb 15, 2018
Upgrade Ubuntu Xenial (16) to Artful (17.10) under WSL

Make sure Ubuntu can find the new version

$ sudo sed -i -e 's/^Prompt=.*$/Prompt=normal/' /etc/update-manager/release-upgrades

Check what can be installed

$ lsb_release -a
johanforssell / Språk
Last active Nov 9, 2015
Valbara språk för modersmålsundervisning, Umeå kommun
View Språk
johanforssell / .bashrc
Created Sep 28, 2015
A reasonable bash prompt with colorized git status
View .bashrc
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
local ansi=41
View Microsoft.PowerShell_profile.ps1
# You can edit this file with `editor_name $profile`
# I'm using Visual Studio Code, so it's `code $profile`
# In order to run this script you need to change the
# execution policy. Run a powershell as admin and do this:
# Set-ExecutionPolicy RemoteSigned
johanforssell / gist:ffeaad858bb671be327b
Last active Aug 29, 2015
Reset all the iOS simulators you've got
View gist:ffeaad858bb671be327b
instruments -s devices | \
grep Simulator | \
grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}" | \
xargs xcrun simctl erase
johanforssell / NSString+Filter
Created Dec 17, 2014
NSString category for filtering text
View NSString+Filter
#import <Foundation/Foundation.h>
@interface NSString (Filter)
/// Only allow A-Z, a-z, 0-9 and underscore.
- (BOOL)isAlphanumericOrUnderscore;
@implementation NSString (Filter)
- (BOOL)isAlphanumericOrUnderscore
NSMutableCharacterSet *set = [NSMutableCharacterSet alphanumericCharacterSet];
You can’t perform that action at this time.