Skip to content

Instantly share code, notes, and snippets.

View varemenos's full-sized avatar

Adonis Kakoulidis varemenos

View GitHub Profile
@varemenos
varemenos / 1.README.md
Last active October 9, 2025 17:15
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
@varemenos
varemenos / getparam.js
Created April 29, 2012 03:50 — forked from alkos333/gist:1771618
JQuery - GET URL Parameter value
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}
@varemenos
varemenos / 1.fetch2base64.js
Last active March 10, 2022 22:31
Get an asset via the Fetch API and convert it to a base64 string
var path = 'http://adonisk.com/img/vlogo.jpg';
fetch(path).then(function (response) {
response.body.getReader().read().then(function(result) {
return btoa(String.fromCharCode.apply(null, result.value));
}).then(function(b64) {
console.log(b64);
});
});
@varemenos
varemenos / curl.php
Created May 10, 2012 19:59
PHP - download url content via CURL
<?php
// usage:
curl_download('http://url');
function curl_download($Url){
// is cURL installed yet?
if (!function_exists('curl_init')){
die('Sorry cURL is not installed!');
}
These are the configuration and package-syncing files I'm using for my setup of the Atom Editor
@varemenos
varemenos / myfunc.js
Last active April 9, 2018 14:32
Sample Javascript module boilerplate
(function (root, name, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root[name] = factory();
}
@varemenos
varemenos / _README.md
Last active June 25, 2017 22:16
Utilizing Array.prototype.reduce to replicate methods in Array's prototype

Reduce.js

This is an exercise and a challenge to see how far can I go with reduce and how many built-in Array methods I can replicate with it.

ToC

  1. concat
  2. every
  3. filter
  4. findIndex
@varemenos
varemenos / responsive.html
Created February 28, 2013 21:12
Responsive Viewer
<html>
<head>
<meta charset="UTF-8">
<title>simple Responsive viewer by Adonis K.</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css"></link>
<style>
iframe {
transition: 150ms ease;
display: block;
margin: 0 auto;
@varemenos
varemenos / .hyper.js
Created December 7, 2016 09:55
hyper config
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// `BEAM` for |, `UNDERLINE` for _, `BLOCK` for █
cursorShape: 'BLOCK',
@varemenos
varemenos / oh-my-zsh-action-aliases.zsh
Last active December 7, 2016 00:30
oh-my-zsh Action Aliases
alias untar='tar -zxvf'
alias untarxz='tar -xJf'
alias pbcopy='xclip -selection clipboard' # OSX compatibility
alias pbpaste='xclip -selection clipboard -o' # OSX compatibility
alias orphans='sudo pacman -Rs $(pacman -Qdtq)' # removes orphan packages from Archlinux