Skip to content

Instantly share code, notes, and snippets.

View balazsbohonyi's full-sized avatar

Bohonyi Balazs - Zsolt balazsbohonyi

View GitHub Profile
@balazsbohonyi
balazsbohonyi / readme.md
Last active April 9, 2024 22:33
'more' in Git Bash

Add an alias for more in .bashrc:

alias more=/proc/cygdrive/c/Windows/System32/more.com

...and then you can use it like this in Git Bash:

cat large_file | more

To increase less's screen width in Git Bash, try this: git config --global core.pager "env -u COLUMNS less"

@balazsbohonyi
balazsbohonyi / readme.md
Last active March 29, 2024 01:16
The best Windows utility for Win11
@balazsbohonyi
balazsbohonyi / node_create_a_redirect_server.md
Created January 17, 2024 12:30 — forked from leommoore/node_create_a_redirect_server.md
Create a redirect server in Node.js

#Create a redirect server in Node.js

'use strict'

var http = require('http');

var mappings = {
 g: 'http://www.google.com'

#Windows node_gyp Compile Problems

When you are compiling node-gyp components during the npm install process you may hit problems when it tries to figure out the version of Microsoft C++ that you have available.

##Typical Problems

fatal error C1083: Cannot open include file: 'vcruntime.h': No such file or directory

I need to geotag every photo from trip to .gpx track, but GPX Logger accidentaly stopped. Luckly, i has turned on Google location history.

  1. Takeout location history from google.
  2. Extract .json file
  3. trigger the following commands
git clone https://github.com/Scarygami/location-history-json-converter.git

py location-history-json-converter-master/location_history_json_converter.py -f gpx -s 2017-05-06 -e 2017-05-07 "Takeout/Location History/Records.json" "Takeout/Location History/Records.gpx"
@balazsbohonyi
balazsbohonyi / businessDays.js
Created August 8, 2013 18:55
Adding/Subtracting Business Days in Javascript (extends the native Date Javascript object)
Number.prototype.mod = function(n) {
return ((this%n)+n)%n;
}
// support for adding/subtracting business days for Javascript dates
Date.prototype.addBusinessDays = function(days) {
days = parseInt(days);
var wks = Math.floor(days/5);
var dys = days.mod(5);
var dy = this.getDay();
@balazsbohonyi
balazsbohonyi / resource_routes_snippet
Created July 21, 2013 10:34
Laravel resource routes snippet for Sublime Text 2
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@balazsbohonyi
balazsbohonyi / Make sure we're running on Honeycomb or higher to use ActionBar APIs
Created January 1, 2013 12:12
Make sure we're running on Honeycomb or higher to use ActionBar APIs
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// For the main activity, make sure the app icon in the action bar
// does not behave as a button
ActionBar actionBar = getActionBar();
actionBar.setHomeButtonEnabled(false);
}
@balazsbohonyi
balazsbohonyi / jquery.imagesloaded.js
Created October 14, 2012 23:12 — forked from desandro/jquery.imagesloaded.js
imagesLoaded jQuery plugin
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.