Skip to content

Instantly share code, notes, and snippets.

View drselump14's full-sized avatar
:octocat:
Focusing

Slamet Kristanto drselump14

:octocat:
Focusing
  • Tokyo, Japan
View GitHub Profile
@agzam
agzam / zathura-client.org
Last active December 12, 2024 20:19
Open pdf files with Zathura on Mac

Zathura on Mac

I want to open PDF files with Zathura on Mac. Problem is - Zathura does not have a proper App Bundle. So you cannot go in Finder to a pdf file, navigate to ‘Get Info’ and set pdf files to be opened with Zathura.

Luckily, you can create a custom App Bundle that wraps up a script that does that

But that is not as straightforward as you think it is, you can’t just execute a shell script. What if the file already opened with one of the instances of zathura process? Since Zathura is not a native OSX app, it will create a new process instance every time you open it.

The following script opens a file in Zathura, and if it was already opened, it would only activate the right window.

How to use it

@ipmb
ipmb / Dockerfile
Last active July 12, 2024 07:50
amazon-ssm-agent Dockerfile
FROM golang:1.12-alpine as builder
ARG VERSION=2.3.930.0
RUN set -ex && apk add --no-cache make git gcc libc-dev curl bash && \
curl -sLO https://github.com/aws/amazon-ssm-agent/archive/${VERSION}.tar.gz && \
mkdir -p /go/src/github.com && \
tar xzf ${VERSION}.tar.gz && \
mv amazon-ssm-agent-${VERSION} /go/src/github.com/amazon-ssm-agent && \
cd /go/src/github.com/amazon-ssm-agent && \
echo ${VERSION} > VERSION && \
gofmt -w agent && make checkstyle || ./Tools/bin/goimports -w agent && \
@eRQee
eRQee / indonesia-radio.m3u
Last active June 22, 2024 09:49
Indonesian Online Radio Playlists (Supported Player: Radio++, GoodVibes). More lists is coming.
#EXTM3U
#EXTINF:0,Andika FM
#EXTVLCOPT:network-caching=1000
http://stream2.andikafm.com:1057/andikafm
#EXTINF:0,Ardan Radio
#EXTVLCOPT:network-caching=1000
http://listento.ardanradio.com:1059/;
#EXTINF:0,Attaqwa FM
#EXTVLCOPT:network-caching=1000
http://103.28.148.18:8840/;
import UIKit
import SnapKit
class ViewController: UIViewController {
var scrollView: UIScrollView!
var stackView: UIStackView!
override func viewDidLoad() {
super.viewDidLoad()
@petelacey
petelacey / beanstalk_nginx.conf
Last active April 9, 2019 13:45
Nginx always-on SSL config for ElasticBeanstalk
files:
"/etc/nginx/conf.d/000_APP_NAME.conf":
mode: "000755"
owner: root
group: root
content: |
upstream APP_NAME_app {
server unix:///var/run/puma/my_app.sock;
}
@pascalpoitras
pascalpoitras / 1.md
Last active March 3, 2025 13:44
My WeeChat configuration

This configuration is not maintained anymore. You should think twice before using it, Breaking change and security issue will likely eventually happens as any abandonned project.

@chensoren
chensoren / gist:3081968
Created July 10, 2012 08:10
ruby openssl AES encrypt and decrypt
require 'base64'
require 'digest'
require 'openssl'
module AESCrypt
def AESCrypt.encrypt(password, iv, cleardata)
cipher = OpenSSL::Cipher.new('AES-256-CBC')
cipher.encrypt # set cipher to be encryption mode
cipher.key = password
@ohta-rh
ohta-rh / gist:2833135
Last active October 5, 2015 16:07
Ruby association Silver
#coding: utf-8
#別名メソッドに気をつけよう。
#たとえば
#array.mapとarray.collectは同じメソッドです。
#自己破壊メソッドはポインタ参照が変わらないため、変数bは変数aの内容を表示する。
a = [1,2,3]
b = a
a.reverse!
p b
@dstroot
dstroot / install-redis.sh
Created May 23, 2012 17:56
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@tjh
tjh / character_set_and_collation.rb
Created January 31, 2012 16:07
Convert all Rails table column collation and character set
#!/usr/bin/env ruby
# Put this file in the root of your Rails project,
# then run it to output the SQL needed to change all
# your tables and columns to the same character set
# and collation.
#
# > ruby character_set_and_collation.rb
DATABASE = ''