Skip to content

Instantly share code, notes, and snippets.

View dentarg's full-sized avatar
🌦️
=:D><!

Patrik Ragnarsson dentarg

🌦️
=:D><!
View GitHub Profile
@dentarg
dentarg / close_notifications_applescript.js
Created February 11, 2022 13:36 — forked from lancethomps/close_notifications_applescript.js
AppleScript to close all notifications on macOS Big Sur
function run(input, parameters) {
const appName = "";
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
const CLOSE_ACTION = "Close";
@dentarg
dentarg / heroku-ci-sample-timings-and-cost.md
Created December 11, 2021 12:43 — forked from jasonrudolph/heroku-ci-sample-timings-and-cost.md
Sample timings and costs using various Heroku CI dyno types

Sample timings (in seconds)

Sample timings using Heroku CI for a small-ish Rails 6 app on various Heroku dyno types:

Dyno Type Run 1 Duration Run 2 Duration Run 3 Duration Average Duration
standard-1x 312 213 303 276
standard-2x 227 121 222 190
performance-m 162 164 175 167
performance-l 100 104 107 104
@dentarg
dentarg / update-gems.yml
Created February 8, 2020 17:07 — forked from filipkis/update-gems.yml
GitHub Action Workflow for updating gems after dependabot push
name: Update Gems After Dependabot
on:
push:
branches:
- 'dependabot/bundler/**'
paths:
- 'Gemfile.lock'
jobs:
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
(ns clojure-twingly-search-api.core
(:gen-class))
(defn get-posts [keyword]
(->
(new com.twingly.search.client.UrlConnectionClient(System/getenv "TWINGLY_SEARCH_KEY"))
(.makeRequest (.build (com.twingly.search.QueryBuilder/create keyword)))
(.getPosts)))
; Lie, limited to 1000
@dentarg
dentarg / install_pdftk.sh
Last active October 12, 2018 11:01 — forked from rmehner/install_pdftk.sh
Install PDFTk without touching up the permissions
#!/usr/bin/env bash
# This is based on this excellent gist https://gist.github.com/jvenator/9672772a631c117da151
# Nothing of this is my original work, except that I made the download link an argument
# to this script, so it installs on OSX 10.11
#
# Thank you jvenator & sethetter
set -e
error() { info "$1"; exit 1; }
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example:
- Use create in the index API (assuming you can).
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval).
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap.
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000).
- Increase the memory allocated to elasticsearch node. By default its 1g.
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine.
- Increase the number of machines you have so
@dentarg
dentarg / host
Last active December 23, 2015 16:09 — forked from pearkes/host
If you run `host` with https://google.com, this strips http[s]:// and the trailing / (zsh only)
#!/usr/bin/env zsh
# I only use host for checking records, and 9 times out of 10
# I copy paste the url from my browser. Chrome adds http[s]://.../
if [ -n "$1" ]
then
# 1 parameter, let's do this thing
/usr/bin/host ${${1#*//}%/*}
else
@dentarg
dentarg / githubber.rb
Last active October 31, 2023 18:16 — forked from iain/githubber.rb
require 'mechanize'
require 'yaml'
$results = []
def find(a, link)
puts "find started on #{link}"
a.get link do |page|
page.search(:css, ".blog-post").each do |post|
h2 = post.search(:css, "h2").first