Skip to content

Instantly share code, notes, and snippets.

View agrublev's full-sized avatar
💭
Always moving forward

Angel Grablev agrublev

💭
Always moving forward
View GitHub Profile
@agrublev
agrublev / RECURS_OBJECTS.js
Last active April 23, 2019 19:13
Recursive object manipulation
const iterateObject = (obj, executeOnValue) => {
Object.keys(obj).forEach(name=> {
let val = obj[name];
if (typeof val === "object") {
return iterateObject(val, executeOnValue);
} else if (val === undefined) {
obj[name] = "";
} else {
obj[name] = executeOnValue(val);
}
@prasanthj
prasanthj / lirc-pi3.txt
Last active January 5, 2023 01:35
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@agrublev
agrublev / app.js
Created September 14, 2017 04:18 — forked from ColCh/app.js
catch errors and send 'em to Crashlytics in React Native
// WARNING: SIDE-EFFECTS. ONLY FOR PROD VERSION
if (!__DEV__) {
require('./utils/log.js');
}
// SIDE-EFFECTS END
@luizcarraro
luizcarraro / open-external-link.js
Created July 27, 2017 11:37
ELECTRON: Open link in external default OS browser
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@ColCh
ColCh / app.js
Created February 24, 2017 13:25
catch errors and send 'em to Crashlytics in React Native
// WARNING: SIDE-EFFECTS. ONLY FOR PROD VERSION
if (!__DEV__) {
require('./utils/log.js');
}
// SIDE-EFFECTS END
@yozzi
yozzi / solved.txt
Created February 10, 2016 22:21
SOLVED! WORDPRESS ASKING FOR LOCAL FTP CREDENTIALS ON XAMPP
SOLVED! WORDPRESS ASKING FOR LOCAL FTP CREDENTIALS ON XAMPP
A few developers were asking why their localhost instances of WordPress were asking for FTP credentials when trying to install new plugins and themes. If you’re getting the dreaded “Please enter your FTP credentials” page and you’re running XAMPP for your local WP development environment, do not follow the popular StackOverflow answer that tells you to chown your wordpress folder to _www. Read more for the real fix.
There’s a Stackoverflow page that tells you to chown your local environment to www, but according to the <a href=“http://www.apachefriends.org/en/xampp-macosx.html” target=“blank”>recent XAMPP documentation, Apache is running as user ‘daemon.’
So the fix is to go into your Terminal and cd to your local directory. If you develop a lot of wordpress stuff at the same time, you can just chown your htdocs directory (remember that you should never use XAMPP as a production environment, which means you should never follow these ideas for live
@codeinthehole
codeinthehole / osx_bootstrap.sh
Last active April 28, 2024 15:26
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@edsilv
edsilv / gist:5f40207ed75119b5eab5
Created February 1, 2015 17:55
extract svn .dump file
## use standard windows command prompt
cd C:\Program Files\SlikSvn\bin
mkdir c:\dumpRepo
svnadmin create c:\dumpRepo
type c:\myproject.dump | svnadmin load c:\dumpRepo
svn export file:///c:/dumpRepo c:\myproject