Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / json-to-ndjson.md
Last active January 31, 2024 20:57
JSON to NDJSON

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
  • Line separator is ‘\n’

1. Convert JSON to NDJSON?

cat test.json | jq -c '.[]' > testNDJSON.json
@alexkrauss
alexkrauss / gitlab-timeline.html
Created August 16, 2018 07:17
Timeline charts for Gitlab build jobs
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// This is a quick hack to be able to see Gantt-like Timelines of gitlab build pipelines.
// It makes it easier to diagnose the running time of the pipelines and understand resource usage.
// Ideally, gitlab would directly provide such a view in its frontend.
google.charts.load('current', {'packages':['gantt']});
@mostafa-asg
mostafa-asg / Css styles
Last active August 27, 2022 21:05
centering images in Hugo - Based on this article : (http://www.ebadf.net/2016/10/19/centering-images-in-hugo/)
img[src$='#center']
{
display: block;
margin: 0.7rem auto; /* you can replace the vertical '0.7rem' by
whatever floats your boat, but keep the
horizontal 'auto' for this to work */
/* whatever else styles you fancy here */
}
img[src$='#floatleft']
@ZackStone
ZackStone / slack-invite-all-members-to-a-channel.js
Created April 14, 2017 13:48
Invite all team members to a Slack channel
/*
https://webapps.stackexchange.com/questions/100820/how-do-i-invite-all-team-members-to-a-new-slack-channel#answer-104062
Instructions: Just browse to the appropriate channel and paste
this script (below) into your Chrome/Firefox dev console and hit enter.
Then wait for the script to run until it completes.
It might take time as there is a limit to how many users may be invited at once.
The script will loop until all team members are invited.
*/
var foundAny=false;
function selectAllByLetter(remainingLetters) {
@mfrister
mfrister / raml-api-console-for-development.md
Last active November 11, 2015 10:36
RAML API Console for Development

Installation

npm install -g http-server

API Console unfortunately is not available on NPM. See its README for installation instructions.

You might have to run grunt after installation. Grunt opens a web page, just close it.

Run:

@mfrister
mfrister / ruby-flamegraphs.md
Last active August 31, 2015 06:54
Ruby Flamegraphs

ruby-prof Flamegraphs

ruby-prof

require 'ruby-prof'
require 'ruby-prof-flamegraph'
result = RubyProf.profile do

 # code to profile
@opahk
opahk / gist:a2f6f469b11230059315
Created August 21, 2014 12:47
ruby/js testing tools
base
* simplecov
* rspec
* capybara
quality
* checker
* rails_best_practices
* jslint
* coffeelint
@opahk
opahk / check threshold and complexity after running tests
Created August 21, 2014 12:41
code coverage build thresholds
bundle exec cane --no-doc --gte "path/to/coverage/covered_percent,99" --lte "path/to/coverage/missed_lines,28"
@aras-p
aras-p / preprocessor_fun.h
Last active June 18, 2024 14:45
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@fxn
fxn / Action Mailer
Created January 20, 2012 17:20
Ruby on Rails v3.2.0 CHANGELOGs
## Rails 3.2.0 (January 20, 2012) ##
* Upgrade mail version to 2.4.0 *ML*
* Remove Old ActionMailer API *Josh Kalderimis*