Skip to content

Instantly share code, notes, and snippets.

@NickClark
NickClark / index.html
Created August 4, 2017 01:29
Type issue in nw.js
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
</head>
<body>
<b>
<script>
document.write(
chrome.extension.getBackgroundPage().Function === Function
@NickClark
NickClark / thoughts.markdown
Last active September 27, 2021 22:33
Elm vs TypeScript Thoughts

Elm and TypeScript

  • Elm Task - An Elm specific implementation of Observables (more limited?)
  • TS and Elm - Once it compiles it usually runs (Provided you're following the warnings provided in either the compiler output (better) or editor (best) )
  • Editor and tooling support?
  • TS and Elm - Typed Langs
  • Most suitable for complete apps, not just a JS compiler
  • Enforces Reactive programming - Angular 2 (Observables) provides the same thing, just not forced.
  • Know TS, know JS. Able to contribute back to the community easier.
  • Object assignment kinda weird: { point | x = 42 } Reason? (overall weird sytnax)
# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 8.4G 8.3G 0 100% /
none 4.1k 0 4.1k 0% /sys/fs/cgroup
udev 4.0G 13k 4.0G 1% /dev
tmpfs 785M 422k 784M 1% /run
none 5.3M 0 5.3M 0% /run/lock
none 4.0G 0 4.0G 0% /run/shm
none 105M 0 105M 0% /run/user
/dev/xvdb 32G 12G 19G 40% /mnt
puts 'Hello there, and what\'s your name?'
name = gets
pp name
name = name.chomp
pp name
puts 'Your name is ' + name + '? What a lovely name!'
puts 'Pleased to meet you, ' + name + '. :)'

==Why am I getting the warnings?==

@NickClark
NickClark / a.markdown
Created April 22, 2012 01:36
Windows Compilation

I have a lib I am trying to link against at:

hitt\ext\hittsdk\H-ITTSDK_2.0.4\lib\windows\h-ittsdk.dll

It can find the header file at:

hitt\ext\hittsdk\H-ITTSDK_2.0.4\include\H-ITTSDK.h

I have this working on my Mac, but I need to now get it working on windows.

@NickClark
NickClark / sdk.rb
Created March 28, 2012 16:26
Trouble with ffi and multi arch lib
#console output
$ ruby lib/hitt/sdk.rb
/Users/nick/.rvm/gems/ruby-1.9.3-p0-perf/gems/ffi-1.0.12.rc1/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'lib/ext/libH-ITTSDK.so': dlopen(lib/ext/libH-ITTSDK.so, 5): no suitable image found. Did find: (LoadError)
lib/ext/libH-ITTSDK.so: unknown file type, first eight bytes: 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A
from /Users/nick/.rvm/gems/ruby-1.9.3-p0-perf/gems/ffi-1.0.12.rc1/lib/ffi/library.rb:88:in `map'
from /Users/nick/.rvm/gems/ruby-1.9.3-p0-perf/gems/ffi-1.0.12.rc1/lib/ffi/library.rb:88:in `ffi_lib'
from lib/hitt/sdk.rb:5:in `<module:Sdk>'
from lib/hitt/sdk.rb:3:in `<main>'
@NickClark
NickClark / toggle_field_on_select_value.js
Created June 14, 2011 16:15
How do you create a jquery plugin that needs to keep state?
$.fn.toggle_field_on_select_value = function(select_input, value) {
toggle = function (){
$select = $(select_input);
$this = $(this);
if($select.attr("value") == value){
$this.slideDown();
}else{
$this.slideUp();
}
}
@NickClark
NickClark / Error
Created May 13, 2011 01:09
Deployment Gemfile.lock woes
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have deleted from the Gemfile:
* guard-pow
* rb-fsevent
@NickClark
NickClark / explain.markdown
Created May 4, 2011 21:38
Error using launchy with cucumber and spork.

Description

This error occurs when I run this feature with spork. If I run it without spork, then it works as expected.