Skip to content

Instantly share code, notes, and snippets.

View LOZORD's full-sized avatar
💭
i'm chillin

Leo Rudberg LOZORD

💭
i'm chillin
View GitHub Profile
@roman
roman / Zip.hs
Created August 23, 2011 17:13
Haskell's zip and zipWith functionality in Clojure
numbers :: [Int]
numbers = zip [1, 2, 3] [4, 5, 6]
main :: IO ()
main = print numbers
-- Output: [(1,4), (2,5), (3,6)]
@misshie
misshie / viterbi.rb
Created September 18, 2011 12:05
A Ruby implementation of the Viterbi algorithm based on the hidden Markov model (HMM)
# A Ruby implementation of
# the Viterbi algorithm based on the hidden Markov model (HMM)
#
# An original Python code: a Wikipedia page "Viterbi algorithm" at
# http://en.wikipedia.org/wiki/Viterbi_algorithm
#
# Author: MISHIMA, Hiroyuki
#
require 'pp'
@jonnyreeves
jonnyreeves / testrunner.html
Created June 2, 2012 13:32
Unit Testing Promises with Sinon.js
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
<!-- when.js Promises implementation -->
<script src="https://raw.github.com/cujojs/when/master/when.js"></script>
<!-- Unit testing and mocking framework -->
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>
@yanofsky
yanofsky / LICENSE
Last active October 17, 2024 22:49
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@radcliff
radcliff / ascii.rb
Created April 8, 2014 01:38
A simple ruby program that prints an ASCII art triangle.
#Simple ASCII Art
puts "What character do you want to make the pyramid out of?"
character = gets.chomp
puts "How many rows of #{character}'s do you want?"
row_count = gets.chomp.to_i
character_count = 1
width = 100
@zeroeth
zeroeth / demo-links.txt
Created April 9, 2014 18:05
the demo scene
@john2x
john2x / 00_destructuring.md
Last active August 23, 2024 07:45
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@Zulko
Zulko / cubes_pyode_vapory.py
Last active December 27, 2023 12:29
3D cubes animation with PyODE and Vapory
"""
Physics simulation with PyODE followed by a (basic) rendering with Vapory
See the result here: http://i.imgur.com/TdhxwGz.gifv
Zulko 2014
This script is placed in the Public Domain (Licence Creative Commons 0)
"""
@sahat
sahat / confirmPassword.js
Created December 27, 2014 05:16
Confirm Password
angular.module('MyApp')
.directive('repeatPassword', function() {
return {
require: 'ngModel',
link: function(scope, elem, attrs, ctrl) {
var otherInput = elem.inheritedData("$formController")[attrs.repeatPassword];
ctrl.$parsers.push(function(value) {
if (value === otherInput.$viewValue) {
ctrl.$setValidity('repeat', true);
@yarko3
yarko3 / tmux_basics.md
Created December 19, 2017 16:43
Tmux Basics (Navigation, Tabs, Splits)

Basics

  • there is the concept of a trigger in tmux; a key combo that allows you to follow up with other keys to do some tmux specific stuff
  • the default trigger is ctrl+b; this is awkward for some people so they use ctrl+a (I do this)
  • hitting ctrl+b followed by : will let you go into a mode similar to the vim command mode (where you can type out some commands)

Working with Tabs

  • open a new tab
    • trigger (ctrl+b) followed by c
    • c stands for create
  • go to next tab