Skip to content

Instantly share code, notes, and snippets.

View omnikron's full-sized avatar
🐋
💨

Oli Barnett omnikron

🐋
💨
  • DE-NRW
  • 07:19 (UTC +01:00)
View GitHub Profile
@omnikron
omnikron / defer-test.html
Created July 31, 2019 08:13
dynamic defer
<html>
<head>
<script>
//var sdkURL = "blah";
//if (window.location.href.indexOf("testUI=enabled") >= 0) {
// sdkURL += "&loadTesting";
//}
var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript'
var code = "window.alert('initial dynamic')"

Keybase proof

I hereby claim:

  • I am omnikron on github.
  • I am omnikron (https://keybase.io/omnikron) on keybase.
  • I have a public key ASDM1GJwWGtVg5MEVdJ8aYaQWJNpy3Xew0u9EEZ37V6V4Qo

To claim this, I am signing this object:

{
"presets": ["react-native", "flow", "react-native-dotenv"],
"plugins": [
"react-hot-loader/babel",
[
"module-resolver",
{
"root": ["../../"],
"alias": {
"src": "./src"
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 19 2015 14:48:49)
MacOS X (unix) version
Included patches: 1-922
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
@omnikron
omnikron / gist:3b21a2f838939c5d697ec185587d1e94
Created October 11, 2017 06:32
targets.vim error on `ci'`
Error detected while processing function targets#o[8]..<SNR>67_findTarget[8]..<SNR>67_findRawTarget[15]..<SNR>67_quoteDir:
line 7:
E121: Undefined variable: col:
E15: Invalid expression: line[col:]
line 12:
E121: Undefined variable: right
E116: Invalid arguments for function s:count(s:opening, right)
E15: Invalid expression: s:count(s:opening, right)
line 16:
E121: Undefined variable: rc
@omnikron
omnikron / elegant_log.rb
Created June 9, 2016 12:22
Elegantly logs rails params in aligned `key: value` form
module ElegantLog
extend ActiveSupport::Concern
def elegant_log(params, display_name = nil)
return if params.blank?
spacer
Rails.logger.info display_name || params.delete(:controller).titleize
longest_length = params.keys.sort {|k1, k2| k2.length <=> k1.length}.first.length
@omnikron
omnikron / oli.rb
Last active August 29, 2015 13:56 — forked from bjjb/monty.rb
#!/usr/bin/env ruby
# Monty Hall problem proof http://en.wikipedia.org/wiki/Monty_Hall_problem
module Monty
PLAYERS_WITH_POLICY = { jimmy: :switch, jasper: :stick, johnson: :random }
DOORS = [:goat, :goat, :ferrari]
COUNT = Integer(ARGV[0] || 100000)
class << self
def win?(policy)
doors = DOORS.dup.shuffle
@omnikron
omnikron / vimrc
Created September 19, 2013 11:03
" Oli new stuff
" ====================================
" Press space in normal mode to enter a command
nnoremap <Space> :
" Pretty lines
set fillchars=vert:\
" make backspace work like most other apps
set backspace=2
@omnikron
omnikron / gist:5858909
Created June 25, 2013 14:30
jQuery - live update while typing (just like Angular)
# Show euro total when editing account payment plans
$(".input .integer[id^='account_payment_plans_attributes']").each ->
value = $(@).attr('value') / 100 / 1000
$(@).parent().next('.euros').html(" = €#{$(@).attr('value') / 100 / 1000 }")
$(".input .integer[id^='account_payment_plans_attributes']").on 'keyup', ->
$(@).parent().next('.euros').html(" = €#{$(@).attr('value') / 100 / 1000 }")
java -jar /usr/local/Cellar/selenium-server-standalone-grid/2.32.0/selenium-server-standalone-2.32.0.jar -p 4444 -role hub