The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into in a mcve. For more information, please see ask and take the tour.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Copyright (c) 2016 Ulysse Buonomo <buonomo.ulysse@gmail.com> (MIT license) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
students_by_option = {} | |
[["gym", "eddy"], ["theater", "john"], ["gym", "ned"]].each do |option, student| | |
students_by_option[option] = [] if students_by_option[option].nil? | |
students_by_option[option] << student | |
end | |
p students_by_option["theater"] # ["john"] | |
p students_by_option # { "gym" => ["eddy", "ned"], "theater" => ["john"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by: https://stackoverflow.com/a/11934977/6320039 | |
# proof of concept: https://regex101.com/r/RkHel3/2 | |
def fold(str, length: 80, sep: "\\s") | |
return str if str.length < length | |
regexp = /((^[^#{sep}]{#{length - 1}})?(?(2)|^.{1,#{length - 2}}#{sep}))(.*)/ | |
_, folded, _, rest = *str.match(regexp) | |
"#{folded}⤶\n#{fold("⤷" + rest, length: length, sep: sep)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Forked from: https://gist.github.com/jdennes/7013672. | |
# | |
# I improved the request output! | |
curl -G https://api.github.com/search/repositories \ | |
--data-urlencode 'q=stars:>1000' \ | |
--data-urlencode 'sort=stars' \ | |
--data-urlencode 'order=desc' \ | |
-H 'Accept: application/vnd.github.preview' \ | |
| jq --raw-output '.items | .[] | (.full_name + " (" + (.stargazers_count | tostring) + ")")' \ | |
| cat -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install nodejs-legacy nodejs npm | |
npm config set prefix ~/npm | |
sudo ln -s /usr/bin/nodejs /usr/bin/node | |
sudo -H npm install -g ungit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name talkie | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Safe talking on hangout | |
// @author You | |
// @match https://hangouts.google.com/u/*/call/* | |
// @grant none | |
// ==/UserScript== |
- Install the ruby extension pack.
bundle install --binstubs
to havebin/<executable>
- create a launch.json and add the configuration:
{ "name": "TODO", "type": "Ruby", "request": "launch", "program": "${workspaceRoot}/bin/TODO",
"cwd": "${workspaceRoot}",
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go to the dataclip listing (https://data.heroku.com/dataclips). | |
// Then execute this script in your console. | |
// Be careful, this will focus a new window every 4 seconds, preventing | |
// you from working 4 seconds times the number of dataclips you have. | |
// Retrieve urls and titles | |
let dataclips = Array. | |
from(document.querySelectorAll('.rt-td:first-child a')). | |
map(el => ({ url: el.href, title: el.innerText })) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeout(time = 200) { | |
return new Promise((resolve) => { | |
setTimeout(resolve, time); | |
}) | |
} | |
/** | |
* Prepare archiving, making sure columns are the correct ones. | |
* | |
* @param contents every column names to treat (may be only a part) |