Skip to content

Instantly share code, notes, and snippets.

@phikal
phikal / .dir-locals.el
Last active Apr 18, 2020 — forked from mooz/.dir-locals.el
My flymake settings for C/C++
View .dir-locals.el
;; just an example
((c++-mode . ((flymake-additional-clang-flags . ("-I../" "-std=c++0x")))))
View gist:0a29eeaaa7ba1511f960be46092225c7
[DEBUG] XBPS: 0.51 API: 20151030 GIT: UNSET
[DEBUG] Processing configuration directory: /etc/xbps.d
[DEBUG] /etc/xbps.d: ignoring .empty
[DEBUG] Processing system configuration directory: /usr/share/xbps.d
[DEBUG] Parsing configuration file: /usr/share/xbps.d/00-repository-main.conf
[DEBUG] [repo] `https://repo.voidlinux.eu/current' stored successfully
[DEBUG] /usr/share/xbps.d/00-repository-main.conf: added repository https://repo.voidlinux.eu/current
[DEBUG] Parsing configuration file: /usr/share/xbps.d/xbps.conf
[DEBUG] rootdir=/
[DEBUG] metadir=//var/db/xbps
@phikal
phikal / deldup.sh
Last active May 18, 2017
Delete duplicate files (ie. same hash) within a directory.
View deldup.sh
#!/bin/bash
MDF="/tmp/deldup.md5"
DUP="/tmp/deldup.list"
if [ $MDF -nt . ]; then
echo found cached hash list in $MDF
else
echo -n "hashing files... "
find -O3 . -type f -print0 $@ | xargs -L 1 -P 2 -0 md5sum > $MDF
echo finished
@phikal
phikal / create.sh
Created Sep 29, 2015
Create Palemoon package via fpm
View create.sh
#!/bin/bash
# usage: ... [archive] [package type]
NAME=palemoon
MAINT="email@address.com"
LICE="MPLv3.0"
URL="http://www.palemoon.org/"
VERSION=$(echo $1 | sed 's/^palemoon-//' | sed 's/.en-US.*$//')
ARCH=$(echo $1 | sed 's/^.*linux-//' | sed 's/.tar.bz2$//')
@phikal
phikal / gist:bf8807bb9cca1ba9c86c
Created Sep 19, 2015
palemoon debian package content
View gist:bf8807bb9cca1ba9c86c
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/doc/
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/doc/palemoon/
-rw-r--r-- 0/0 138 2015-09-19 15:45 ./usr/share/doc/palemoon/changelog.Debian.gz
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/icons/
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/icons/hicolor/
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/icons/hicolor/128x128/
drwxr-xr-x 0/0 0 2015-09-19 15:45 ./usr/share/icons/hicolor/128x128/apps/
@phikal
phikal / Makefile
Created Aug 15, 2015
scattering project for Petnica Pi (Monte Carlo Radiative Transfer Simulation)
View Makefile
all: $(ALL)
cc scatter.c -O9 -lm -o scatter
@phikal
phikal / Makefile
Created Aug 15, 2015
scattering project for Petnica Pi (Step by Step Photon 3d Simulation)
View Makefile
all: $(ALL)
cc scatter.c -O9 -lm -o scatter
@phikal
phikal / solarized.xml
Last active Oct 16, 2020
Android colors.xml with the Solarized color scheme - http://ethanschoonover.com/
View solarized.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
Solarized colors.xml (solarized.xml) for Android
by Philip K. [https://dyst.ax.lt/~phi]
-->
<resources>
<!-- hex resources -->
<color name="base03">#002b36</color>
@phikal
phikal / mhsc.html
Created May 3, 2015
Minimal HTTP Submission Client for 4jhan (https://github.com/phikal/4jhan-server)
View mhsc.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Minimal HTTP Submission Client</title>
</head>
<body>
<h1>4jhan MHSC</h1>
<i>Minimal HTTP Submission Client for 4jhan</i><br>
<a href='http://localhost:3000/list'>View List</a>
View optparse.min.js
//Optparse.js 1.0.3-Copyright (c)2009 Johan Dahlberg
//Based on:https://github.com/jfd/optparse-js
//Compressed and removed some redundant features by @phikal
var optparse={};try{optparse=exports;}catch(e){}(function(self){var VERSION='1.0.3';var LONG_SWITCH_RE=/^--\w/,SHORT_SWITCH_RE=/^-\w/,EXT_RULE_RE=/(\-\-[\w_-]+)\s+([\w\[\]_-]+)|(\-\-[\w_-]+)/,ARG_OPTIONAL_RE=/\[(.+)\]/,DEFAULT_FILTER='_DEFAULT',PREDEFINED_FILTERS={};function filter_text(value){return value;}PREDEFINED_FILTERS[DEFAULT_FILTER]=filter_text;PREDEFINED_FILTERS.TEXT=filter_text;function build_rules(filters,arr){var rules=[];for(var i=0;i<arr.length;i++){var r=arr[i],rule;if(!contains_expr(r))throw OptError('Rule MUST contain an option.');switch(r.length){case 1:rule=build_rule(filters,undefined,r[0]);break;case 2:var expr=LONG_SWITCH_RE.test(r[0])?0:1;varalias=expr===0?-1:0;var desc=alias===-1?1:-1;rule=build_rule(filters,r[alias],r[expr],r[desc]);break;case 3:rule=build_rule(filters,r[0],r[1],r[2]);break;default:case 0:continue;}rules.push(r