Skip to content

Instantly share code, notes, and snippets.

View ultim8k's full-sized avatar
🛠️
Rock & roll!

Kostas Kapenekakis ultim8k

🛠️
Rock & roll!
View GitHub Profile
@ultim8k
ultim8k / Default (OSX).sublime-keymap
Created October 16, 2017 09:42
My personal quick and hacky keymap for sublime text
/*
User's sublime-keymap
*/
[
{"keys": ["super+t"], "command": "new_file"},
{"keys": ["super+shift+c"], "command": "insert_snippet", "args": {"contents": "console.log(${1:$TM_SELECTED_TEXT});${0}"}}
]
@ultim8k
ultim8k / .editorconfig
Created September 14, 2017 22:17
project dotfiles
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
@ultim8k
ultim8k / sync-async-chain.js
Created May 18, 2017 16:30
Chaining sync with async functions
function giveLater (num) {
return new Promise (function (resolve, reject) {
setTimeout(function () {
if (num) {
resolve(num);
return false;
}
reject('num is empty');
<!DOCTYPE html>
<html lang="en" class="-capitalise-normal">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>An amazing site</title>
<style>
@media (max-width: 480px) {
.page-title {

foo bar foo bar

foo bar foo bar caption

foo bar foo bar

foo bar

@ultim8k
ultim8k / vim-multiline-comment.md
Last active August 11, 2025 08:56
(un) comment multiple lines vim

From: http://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim

For those tasks I use most of the time block selection.

Put your cursor on the first # character, press Ctrl``V (or Ctrl``Q for gVim), and go down until the last commented line and press x, that will delete all the # characters vertically.

For commenting a block of text is almost the same: First, go to the first line you want to comment, press Ctrl``V, and select until the last line. Second, press Shift``I``#``Esc (then give it a second), and it will insert a # character on all selected lines. For the stripped-down version of vim shipped with debian/ubuntu by default, type : s/^/# in the second step instead.

>Jarvis, do me a favor and blow Mark 42 Galaxy Note 7

Keybase proof

I hereby claim:

  • I am ultim8k on github.
  • I am ultim8k (https://keybase.io/ultim8k) on keybase.
  • I have a public key ASD2xPoCw-slPy8L8t8FO8LQIlPQMnvzKcAWiF3GVMjXKwo

To claim this, I am signing this object:

@ultim8k
ultim8k / palindromic.js
Last active September 7, 2016 16:17
check palindromic text
function isPalindromic(textStr) {
if (!textStr) { return new Error('Missing string parameter.'); }
if (typeof textStr !== 'string') { return new Error('Parameter must be a string.'); }
return textStr.split('').reverse().join('') === textStr;
}
@ultim8k
ultim8k / post-receive
Created August 29, 2016 19:56 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then