Skip to content

Instantly share code, notes, and snippets.

Raine Virta raine

Block or report user

Report or block raine

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
View run
#!/usr/bin/env bash
set -euo pipefail
murobbs() {
curl -s 'https://murobbs.muropaketti.com/forums/naeytoet-tulostimet-ja-muut-lisaelaitteet.207/index.rss?prefix_id=8' |\
xml2json |\
ramda '.rss.channel.item' 'project [\title, \pubDate, \link]' 'map assoc \source \murobbs'
}
View run.sh
#!/usr/bin/env bash
set -euo pipefail
murobbs() {
curl -s 'https://murobbs.muropaketti.com/forums/naeytoet-tulostimet-ja-muut-lisaelaitteet.207/index.rss?prefix_id=8' |\
xml2json |\
ramda '.rss.channel.item' 'project [\title, \pubDate, \link]' 'map assoc \source \murobbs'
}
View make-table.sh
#!/usr/bin/env bash
curl -s https://restcountries.eu/rest/v2/all | \
html-table -o \
--cols flag,code,name,population,area,capital,tld,languages \
--col.flag.cell '<div style="text-align: center"><img src="${flag}" height="20" /></div>' \
--col.flag.header '' \
--col.flag.width 50 \
--col.code.width 40 \
--col.code.cell '${alpha2Code}' \
View test.md

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

View frame-size.ne
@{% function nuller() { return null; } %}
@{% function joiner(d) { return d.join(''); } %}
@{% const R = require('ramda'); %}
main -> any frame_size_candidate _ any {% R.nth(1) %}
frame_size_candidate ->
frame_size_prefix _ ":":? _ frame_size {% R.last %}
| frame_size_tshirt "-size"i {% R.head %}
| frame_size_tshirt _ "koko"i {% R.head %}
View index.js
const params = U.view(['search', searchParamsL], location)
const search = U.atom(params.get().search || '')
const debouncedSearch = U.debounce(300, search)
debouncedSearch
.onValue(q => params.modify(
q ? R.assoc('search', q) : R.dissoc('search')
))
const items = U.thru(
debouncedSearch,
View ch9-exercise.hs
split :: Char -> String -> (String, String)
split c str = (start, rest)
where start = takeWhile (/= c) str
rest = dropWhile (== c) $ dropWhile (/= c) str
myWords :: String -> [String]
myWords [] = []
myWords str = start : (myWords rest)
where (start, rest) = split ' ' str
@raine
raine / connect-to-beats
Created Jan 2, 2018
Connect to Beats headphones from command-line
View connect-to-beats
#!/usr/bin/env bash
# Requirements:
# - Add https://github.com/lapfelix/BluetoothConnector/ to $PATH
mac=`BluetoothDeviceConnector | grep 'Beats Studio³' | awk '{print $1}'`
BluetoothDeviceConnector $mac
@raine
raine / app.js
Last active Oct 10, 2018
Define socket.io once and use it in any view I want?
View app.js
// Setup basic express server
var express = require('express');
var app = express();
// Spool up server
var server = app.listen(app.get('port'), function() {
console.log('App listening on port %d', app.get('port'));
});
// Import socket_api
View people.json
This file has been truncated, but you can view the full file.
[
{"name":"Keeley Bosco","email":"katlyn@jenkinsmaggio.net","city":"Lake Gladysberg","mac":"08:fd:0b:cd:77:f7","timestamp":"2015-04-25 13:57:36 +0700","creditcard":"1228-1221-1221-1431"},
{"name":"Rubye Jerde","email":"juvenal@johnston.name","city":null,"mac":"90:4d:fa:42:63:a2","timestamp":"2015-04-25 09:02:04 +0700","creditcard":"1228-1221-1221-1431"},
{"name":"Miss Darian Breitenberg","email":null,"city":null,"mac":"f9:0e:d3:40:cb:e9","timestamp":"2015-04-25 13:16:03 +0700","creditcard":null},
{"name":"Celine Ankunding","email":"emery_kunze@rogahn.net","city":null,"mac":"3a:af:c9:0b:5c:08","timestamp":"2015-04-25 14:22:22 +0700","creditcard":"1228-1221-1221-1431"},
{"name":"Dr. Araceli Lang","email":"mavis_lehner@jacobi.name","city":"Yvettemouth","mac":"9e:ea:28:41:2a:50","timestamp":"2015-04-25 21:02:11 +0700","creditcard":"1211-1221-1234-2201"},
{"name":"Esteban Von","email":null,"city":null,"mac":"2d:e4:f0:dd:90:96","timestamp":"2015-04-25 21:47:09 +0700","creditcard":null},
You can’t perform that action at this time.