Skip to content

Instantly share code, notes, and snippets.

View inlife's full-sized avatar
🇺🇦
Be Mighty

Vladyslav Hrytsenko inlife

🇺🇦
Be Mighty
View GitHub Profile
@inlife
inlife / caskdo.sh
Last active February 9, 2020 10:11
Search and install desired cask in one move.
# Search for cask, select & install
## 0.1 Inlife
function caskdo {
echo 'Searching...';
OPTIONS=($(brew cask search $1 | grep -e '^[^=]'));
if [[ "$OPTIONS" == *"No Cask found"* ]]; then
echo "Not found anything like \"$1\""
else
echo 'Select number of cask you want to install: '
<?php
header('Content-Type: text/html; charset=utf-8');
/**
* [helper fn for en/de (crypt) strings]
* @var string
*/
$mod = ( isset( $_GET['mod'] ) ? $_GET['mod'] : '' );
$val = ( isset( $_GET['val'] ) ? $_GET['val'] : '' );
function getTrackList() {
var trackNoClass = ".number";
var artistClass = ".section-artist";
var trackClass = ".section-title";
var timeClass = "input.section-time.ng-pristine";
// var artists = [];
var tracks = $(".section-row").map(function() {
var trackNo = $(this).find(trackNoClass).text().trim();
@inlife
inlife / git-alias.sh
Created April 18, 2016 13:59
small aliases for git
# git
alias gitp="git push origin master"
alias gitf="git pull origin master"
alias gits="git status"
function gita {
git add .
if [ -z "$1" ]; then
echo -n "Enter commit message: "
read msg
git commit -m $msg

Keybase proof

I hereby claim:

  • I am inlife on github.
  • I am inlife (https://keybase.io/inlife) on keybase.
  • I have a public key ASBdcGtfPoLhgX7J5lJsseBwgMPPo-mz3pvFz8eYxHq-6Ao

To claim this, I am signing this object:

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@inlife
inlife / url_encode.nut
Created December 4, 2016 17:49
Squirrel url_encode
local R = regexp("[A-Za-z0-9]");
function isalnum(value) {
return R.match(value.tochar());
}
function url_encode(value) {
local escaped = "";
for (local i = 0; i < value.len(); i++) {
@inlife
inlife / uv_read_file.c
Created February 13, 2017 13:58
Sample for reading a file asynchronously using libuv
// Sample for reading a file asynchronously using libuv
// taken from https://www.snip2code.com/Snippet/247423/Sample-for-reading-a-file-asynchronously
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <uv.h>
static uv_fs_t openReq;
static uv_fs_t readReq;
[GAME]D:\Steam\steamapps\common\Mafia II\pc\mafia2.exe.2616.STEAMSTART
[GAME]C:\Users\Inlife\AppData\Local\2K Games\Mafia II\Data\vfs.bin
[GAME]C:\Program Files (x86)\Steam\ClientRegistry.blob
[GAME]C:\Program Files (x86)\Steam\ClientRegistry.blob
[GAME]D:\Steam\steamapps\common\Mafia II\pc\sds_en\info
[GAME]C:\Users\Inlife\AppData\Local\2K Games\Mafia II\Saves\videoconfig.cfg
[GAME]D:\Steam\steamapps\common\Mafia II\edit\sdsconfig.bin
file_patcher: redirecting game file sdsconfig.bin to D:\Projects\m2o-reborn\binary\game_files\sdsconfig.bin
[GAME]D:\Steam\steamapps\common\Mafia II\pc\shaders\ShaderCache[NV__].sc
[GAME]D:\Steam\steamapps\common\Mafia II\pc\shaders\ShaderCache[ATF4].sc
/*
JSON5 parser module
License:
This software is dual-licensed to the public domain and under the following
license: you are granted a perpetual, irrevocable license to copy, modify,
publish, and distribute this file as you see fit.
No warranty is implied, use at your own risk.
Credits: