Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am utgarda on github.
* I am chainhacker (https://keybase.io/chainhacker) on keybase.
* I have a public key ASA1sBCpTHRCyWo8iR_sbSYsV5nU0BVY0h_l9cwsgVrMsgo
To claim this, I am signing this object:
@utgarda
utgarda / README.md
Created January 16, 2012 05:10
CoffeeScript + jQuery tutorials

CoffeeQuery

CoffeeScript + jQuery tutorials

  • Various jQuery tutorials ported to CS
  • CoffeeScript basics
  • Cool colours, not the least of features :)
@utgarda
utgarda / reverse.coffee
Created March 22, 2012 12:25 — forked from Chris927/reverse.coffee
Reverse a string in CoffeeScript
reverse = (s) ->
if s.length < 2 then s else reverse(s[1..-1]) + s[0]
s = "Hello"
console.log "s=#{s}, s.reverse=#{reverse(s)}"
@utgarda
utgarda / 0 Linux-On-MBP-Late-2016.md
Created February 22, 2019 10:32 — forked from roadrunner2/0 Linux-On-MBP-Late-2016.md
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@utgarda
utgarda / versions
Last active February 27, 2017 17:41
version 1
version 2
@utgarda
utgarda / jquery_animation_1.2.html
Created January 12, 2012 16:40
jQuery + CoffeeScript tutorial: animation stacking http://coffeequery.blogspot.com/
<!DOCTYPE html>
<html>
<head>
<title>jQuery + CoffeeScript tutorial: animation stacking</title>
<style>
div.tree-frog {font-size: 12pt; border: 1px solid white; height: 38px; width: 38px; position: absolute}
</style>
<script src="coffee-script.js"></script>
<script src="jquery-1.7.1.js"></script>
</head>
@utgarda
utgarda / ani.stack.1.coffee
Created January 13, 2012 15:56
CoffeeScript + jQuery tutorials: Stacking animations http://coffeequery.blogspot.com
$j = jQuery
$j('#ani2_btn1').click ->
$j('#ani2_worm_bar')
.animate(width:78).animate(left:'+=40',width:38)
@utgarda
utgarda / gzip-sample.scala
Created January 5, 2016 18:31 — forked from sasaki-shigeo/gzip-sample.scala
A sample code of gzip in Scala. API of gzip is included in the package java.util.zip. It provides GZIPOutputStream and GZIPInputStream, the subclasses of DeflatterOutputStream and InflatterInputStream, respectively. GZIPOutputStream compresses data into a given output stream and GZIPInputStream decompresses data from an input one.
import java.io._
import java.util.zip._
val pi = new PipedInputStream
val po = new PipedOutputStream(pi)
val zo = new GZIPOutputStream(po)
val zi = new GZIPInputStream(pi)
val w = new PrintWriter(zo)
val r = new BufferedReader(new InputStreamReader(zi))
@utgarda
utgarda / sinkiq.rb
Created August 5, 2013 17:01
Example of Celluloid::WebSocket::Client usage from inside Sidekiq workers
# Make sure you have Sinatra installed, then start sidekiq with
# sidekiq -r ./sinkiq.rb
# Simply run Sinatra with
# ruby ./sinkiq.rb
# and then browse to http://localhost:4567
#
require 'sinatra'
require 'sidekiq'
require 'redis'
require 'celluloid'
require 'sidekiq'
require 'securerandom'
require 'active_support'
# If your client is single-threaded, we just need a single connection in our Redis connection pool
class GenerateUUID
def call(worker_class, msg, queue)
puts "Here goes middleware, worker_class = #{worker_class}, msg = #{msg}, queue = #{queue}"
if (last_arg = msg['args'].last).is_a? Proc