Skip to content

Instantly share code, notes, and snippets.

View UncleBill's full-sized avatar
😳
K.I.S.S

UncleBill

😳
K.I.S.S
View GitHub Profile
@k0f1sh
k0f1sh / zone-pgm-rainbow
Last active April 27, 2018 15:51
虹色zone
;; zone-pgm-rainbow
(defun decimal->hex (n)
(format "%02X" n))
(defun hsv->rgb (h s v)
(let ((h (max 0 (min 360 h)))
(s (/ (max 0 (min 100 s)) 100.0))
(v (/ (max 0 (min 100 v)) 100.0)))
(if (= 0 s)
@varemenos
varemenos / 1.README.md
Last active April 21, 2024 23:21
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
local wibox = require( "wibox" )
local awful = require( "awful" )
local rad_tag = require( "radical.impl.common.tag" )
local beautiful = require( "beautiful" )
local radical = require( "radical" )
local rad_task = require( "radical.impl.tasklist" )
local chopped = require( "chopped" )
local collision = require( "collision" )
local color = require( "gears.color" )
local infobg = require( "radical.widgets.infoshapes" )
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();