Skip to content

Instantly share code, notes, and snippets.

Nicholas Clark NickClark

  • 59937
View GitHub Profile
@NickClark
NickClark / index.html
Created Aug 4, 2017
Type issue in nw.js
View index.html
<!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 Sep 11, 2018
Elm vs TypeScript Thoughts
View thoughts.markdown

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)
View gist:1aa355aec9f96d4fbb09
# 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
View gist:7266959
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 + '. :)'
View a.markdown

==Why am I getting the warnings?==

@NickClark
NickClark / a.markdown
Created Apr 22, 2012
Windows Compilation
View a.markdown

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 Mar 28, 2012
Trouble with ffi and multi arch lib
View sdk.rb
#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 Jun 14, 2011
How do you create a jquery plugin that needs to keep state?
View toggle_field_on_select_value.js
$.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
Deployment Gemfile.lock woes
View Error
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
Error using launchy with cucumber and spork.
View explain.markdown

Description

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

You can’t perform that action at this time.