Skip to content

Instantly share code, notes, and snippets.

Nils nilsnh

Block or report user

Report or block nilsnh

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
nilsnh /
Created Sep 12, 2015
How to activate / deactivate the internal laptop keyboard when connecting an
# How to disable the internal keyboard
# How to fire script on usb connect
# Todo
1. Is now able to grab the right numbers from xinput.
nilsnh / npm-install-without-sudo
Last active Aug 29, 2015
How to remove the need of sudo when doing npm -g
View npm-install-without-sudo
Quick guide for installing node through NVM in a way that avoids the use of sudo.
1. [First read this](
2. [Then add this fix.](
Now doing npm install -g yo won't make this complaint:
[Error] npm root value is not in your NODE_PATH
nilsnh / CompareFilesFindMissingLines.js
Last active Aug 29, 2015
Compare files and create a new file containing the missing lines. Used like: node File1 File2 FileWithLinesMissingInFile2.txt
View CompareFilesFindMissingLines.js
var fs = require('fs');
var oldReport = [];
var newReport = [];
var missingLines = [];
fs.readFile(process.argv[2], {encoding: "utf8"}, function (err, data) {
if (err) throw err;
oldReport = data.split('\n');
nilsnh / gist:5097730
Last active Dec 14, 2015
Just a simple Harry Potter inspired coffee-script to wow and excite. :)
View gist:5097730
#A function
cast = (spell) ->
console.log "Casting spell: #{spell}"
#Comprehensions. "Syntactic sugar"
mySpellList = ['Expelliarmus', 'Lumos', 'Tarantallegra']
cast spell for spell in mySpellList
#Same as
for spell in mySpellList
nilsnh /
Last active Dec 13, 2015
Coffee-script fizzbuzz. Just had to try and make one after reading this:
for i in [1..100]
if i % 3 is 0 and i % 5 is 0 then console.log "FizzBuzz"
else if i % 3 is 0 then console.log "Fizz"
else if i % 5 is 0 then console.log "Buzz"
else console.log "#{i}"
nilsnh /
Created Nov 30, 2012
A roadmap for pils & programmering spring 2013


  • MyEmacsPP
  • Umbrella: Tv-show (will be marketed against NRK's kulturstripen)
  • FNL: Friday Night Lightning. The second Friday every month.
  • Hackathons


nilsnh / Simple Jena Jython
Created Oct 17, 2011
Slightly modified Jena / Jython example
View Simple Jena Jython
from com.hp.hpl.jena.rdf.model import ModelFactory, Resource
from com.hp.hpl.jena.vocabulary import VCARD
from javax.servlet.http import HttpServlet
#Inspired by:
class HelloSemanticWeb(HttpServlet):
def testSemantic(self):
You can’t perform that action at this time.