Skip to content

Instantly share code, notes, and snippets.

@vonHabsi
vonHabsi / dl_ff_nightly.sh
Created August 23, 2017 17:36
download firefox nightly
#!/bin/bash
set -e
set -x
usage()
{
cat << EOF
dl_ff_nightly - download and install a firefox nightly version
@vonHabsi
vonHabsi / gottabeme-helm-find-files.el
Last active July 23, 2017 10:47
sample helm find files
(defun ap/helm-find-files ()
;; from gottabeme https://www.reddit.com/r/emacs/comments/6ogkp3/how_to_add_more_source_to_helmfindfiles_or/
;; https://stackoverflow.com/questions/11403862/how-to-have-emacs-helm-list-offer-files-in-current-directory-as-options
(interactive)
;; From helm-buffers-list in helm-buffers.el This wasn't necessary
;; until I updated helm...then suddenly helm-source-buffers-list
;; stopped working. And this is why I am reluctant to update
;; things. SIGH.
(unless helm-source-buffers-list
@vonHabsi
vonHabsi / Devblog.adoc
Last active June 22, 2017 09:42
Devblog

2017-06-18

More emacs tips

Whats the best way to package my Emacs installation (packages and config) so that it can quickly be installed anywhere?

2017-06-17

Systemd Running Services As A User

@vonHabsi
vonHabsi / .screenrc
Created April 24, 2017 12:30
Screen RC
#First iteration 2014-09-06, not quite sure of stuff to add
# got a fancy hardstatus line noted below
hardstatus on
hardstatus alwayslastline
# hardstatus string "%w"
# blagged this hardstatus like from https://bbs.archlinux.org/viewtopic.php?id=55618, not quite sure what it does
# extended from http://unix.stackexchange.com/questions/195209 and , uptime command disabled
# http://www.gnu.org/software/screen/manual/html_node/String-Escapes.html#String-Escapes
hardstatus string '%{= kG}%{C}Screen:%{Rk}Host:%H %1`%{c}%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{C} %d-%m %{W}%c %{g}]'
@vonHabsi
vonHabsi / template_test.ex
Last active April 16, 2017 18:40
Template Test in Elixir
defmodule ParamStruct do
defstruct key: "", value: "", default: "", description: "description of parameter", label: "label on web form", required: false, order: 99
end
defmodule TemplateStruct do
defstruct key: "must be unique", name: "descriptive name", code: "", executable: false, destination: "", delete_after: false,
perms: "644"
e
@vonHabsi
vonHabsi / install.sh
Created May 17, 2015 07:04
Bash Script to install FPC-Lazarus crosscompile automatically (64bit system), bangfauzen, Lazarus Forums
#!/bin/sh
#set -x
clear
FPC1=2.6.4
BASE=/hdd/program/Lazarus
FPCBIN=$BASE/source/binary
FPCSRC=$BASE/source/fpc
LAZSRC=$BASE/source/lazarus
ORISRC=$BASE/source/original
@vonHabsi
vonHabsi / genMan2Html.sh
Created April 22, 2015 16:17
Man2Html Viewer Scripts
#generate html versions of man manual pages using man2html
# 20150422
#create directories
mkdir ~/htmlman
cd ~/htmlman
# find manpages and convert them
find $(manpath | tr : ' ') -name '*.gz' |
while read f; do
man2html "$f" > ~/htmlman/"$(basename "$f" .gz)".html;
@vonHabsi
vonHabsi / lazbuild.txt
Created March 26, 2015 05:05
Lazarus Command Line Help
lazbuild [options] <project/package filename or package name>
Parameters:
--help or -? this help message
-B or --build-all build all files of project/package/IDE
-r or --recursive apply build flags (-B) to dependencies too
-d or --skip-dependencies do not compile dependencies
@vonHabsi
vonHabsi / redirect_write.pas
Last active August 29, 2015 14:17
Example of redirecting output of write function.
{
The usage of a text file was merely an example. As I said there already is the possibility to use a TStream provided by FPC. But since I'm nice here you also have an example for a TMemo, I'm sure you can adjust that for your needs:
}
{=== code begin ===}
resourcestring
SErrNilMemo = 'Memo is nil';
type
PMemo = ^TMemo;
@vonHabsi
vonHabsi / fpcjs example.md
Last active August 29, 2015 14:17
Work in Progress Repo Text Files

Unlike original/official Delphi JavaScript bridge, which is due to its complexness not compileable in FPC (FreePascal) and/or doesn't work really well, is too big, bloated and outdated, this project use only js15decl.pas (basically C header) interface from the original bridge and add very small (simple and maintainable) wrapper around it to simplify the usage of Mozilla JavaScript engine in FPC. It also contain set of minimal working demos how to do basic JS stuff from FPC like call JS function, set JS variable, call FPC function from JS, etc... Please use SVN to download the project.

API Overview

If you want to use FpcJs, you need add uses clause first.

uses FpcJs;