Skip to content

Instantly share code, notes, and snippets.

View danielgindi's full-sized avatar

Daniel Cohen Gindi danielgindi

  • Self Employed, CTO at eyedo fielding technologies ltd.
  • Israel
View GitHub Profile
@danielgindi
danielgindi / exec_fun_w_args_isolated.js
Created September 18, 2016 12:50
JS: Execute function given name and args - in an isolate scope
var execIsolated = (function () {
var exec = function () {
arguments[0](arguments[1]);
};
return function (funcname, args) {
args = args || [];
@danielgindi
danielgindi / syntax_convert.js
Last active March 6, 2017 08:12
Convert syntax between languages
/* Note:
This is not meant for translating real code between languages.
Only for basic syntax translation, to get you started with a skeleton,
before doing line-by-line manually
*/
var Converter = {
curlifyWhitespace: function (code) {
@danielgindi
danielgindi / list_files_group_by_ext.sh
Last active April 3, 2016 14:12
(Linux) List file counts grouped by file extension
find ./ -maxdepth 1 -type f | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n
@danielgindi
danielgindi / numlock_on.sh
Last active January 17, 2016 09:24
Enable NumLock on Ubuntu by default
sudo apt-get -y install numlockx
sudo sed -i 's|^exit 0.*$|# Numlock enable\n[ -x /usr/bin/numlockx ] \&\& numlockx on\n\nexit 0|' /etc/rc.local
# http://askubuntu.com/questions/155679/how-to-enable-numlock-at-boot-time-for-login-screen