Skip to content

Instantly share code, notes, and snippets.

@mholt
mholt / macapp.go
Last active April 8, 2024 17:54
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@squito
squito / AccumulatorListener.scala
Last active March 15, 2019 06:34
Accumulator Examples
import scala.collection.mutable.Map
import org.apache.spark.{Accumulator, AccumulatorParam, SparkContext}
import org.apache.spark.scheduler.{SparkListenerStageCompleted, SparkListener}
import org.apache.spark.SparkContext._
/**
* just print out the values for all accumulators from the stage.
* you will only get updates from *named* accumulators, though
@mul14
mul14 / 00_etc-hosts.md
Last active April 2, 2024 06:39
/etc/hosts for Vimeo, Reddit, Imgur, GitHub, DigitalOcean, dll

Unblock Steam, Vimeo, Reddit, Imgur, GitHub, DigitalOcean, NPM, PayPal, dll

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@brwe
brwe / function_score_queries.json
Created October 18, 2013 22:58
Sense input for `function_score` screencast.
POST hire-wire/programmer/_search
POST hire-wire/programmer/_search
{
"script_fields": {
"distance_from_berlin": {
"script": "doc['home'].arcDistanceInKm(52.5,13.5)"
}
},
"fields": [
@odony
odony / .fonts.conf
Last active May 10, 2021 07:54 — forked from silv3rm00n/.fonts.conf
Updated version of the fonts.conf file mentioned in http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/ in order to get rid of most of the fontconfig warnings (mostly the "Having multiple values in <test> isn't supported and may not work as expected")
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@verdana
verdana / install.sh
Last active December 14, 2022 09:15
Shell script to help with installing and configuring Arch linux
#!/bin/sh
# Updated: Wednesday Dec 14, 2022
# 必须以超级用户权限运行,似乎没啥必要...
[[ $EUID != 0 ]] && echo "Please run as root. Terminating..." && exit 1
# 显示系统时间
timedatectl status
echo ""