Skip to content

Instantly share code, notes, and snippets.

View flashfoxter's full-sized avatar
🏠
Working from home

Konstantin Le flashfoxter

🏠
Working from home
View GitHub Profile
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
1. `vim /etc/syslog.conf`
2. Add to end of file: `cron.* /var/log/cron.log`
3.
```
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
```
[where-is-the-cron-log-file-in-macosx-lion](http://apple.stackexchange.com/questions/38861/where-is-the-cron-log-file-in-macosx-lion)
@flashfoxter
flashfoxter / release-android-debuggable.md
Created March 6, 2018 11:13 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@flashfoxter
flashfoxter / removeAllChildFragments
Created April 17, 2018 15:28 — forked from elsennov/removeAllChildFragments
Remove all child fragments inside parent fragment (Nested fragment)
private void removeAllChildFragments() {
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId);
if (childFragmentTags != null && !childFragmentTags.isEmpty()) {
List<Fragment> childFragments = getChildFragmentManager().getFragments();
if (childFragments != null && !childFragments.isEmpty()) {
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
for (Fragment childFragment : childFragments) {
if (childFragment != null) {
if (childFragmentTags.contains(childFragment.getTag())) {
fragmentTransaction.remove(childFragment);
@flashfoxter
flashfoxter / removeAllChildFragments
Created April 17, 2018 15:28 — forked from elsennov/removeAllChildFragments
Remove all child fragments inside parent fragment (Nested fragment)
private void removeAllChildFragments() {
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId);
if (childFragmentTags != null && !childFragmentTags.isEmpty()) {
List<Fragment> childFragments = getChildFragmentManager().getFragments();
if (childFragments != null && !childFragments.isEmpty()) {
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
for (Fragment childFragment : childFragments) {
if (childFragment != null) {
if (childFragmentTags.contains(childFragment.getTag())) {
fragmentTransaction.remove(childFragment);
@flashfoxter
flashfoxter / removeAllChildFragments
Created April 17, 2018 15:28 — forked from elsennov/removeAllChildFragments
Remove all child fragments inside parent fragment (Nested fragment)
private void removeAllChildFragments() {
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId);
if (childFragmentTags != null && !childFragmentTags.isEmpty()) {
List<Fragment> childFragments = getChildFragmentManager().getFragments();
if (childFragments != null && !childFragments.isEmpty()) {
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
for (Fragment childFragment : childFragments) {
if (childFragment != null) {
if (childFragmentTags.contains(childFragment.getTag())) {
fragmentTransaction.remove(childFragment);
@flashfoxter
flashfoxter / removeAllChildFragments
Created April 17, 2018 15:28 — forked from elsennov/removeAllChildFragments
Remove all child fragments inside parent fragment (Nested fragment)
private void removeAllChildFragments() {
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId);
if (childFragmentTags != null && !childFragmentTags.isEmpty()) {
List<Fragment> childFragments = getChildFragmentManager().getFragments();
if (childFragments != null && !childFragments.isEmpty()) {
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
for (Fragment childFragment : childFragments) {
if (childFragment != null) {
if (childFragmentTags.contains(childFragment.getTag())) {
fragmentTransaction.remove(childFragment);
@flashfoxter
flashfoxter / removeAllChildFragments
Created April 17, 2018 15:28 — forked from elsennov/removeAllChildFragments
Remove all child fragments inside parent fragment (Nested fragment)
private void removeAllChildFragments() {
List<String> childFragmentTags = CHILD_FRAGMENT_TAGS_MAP.get(mParentId);
if (childFragmentTags != null && !childFragmentTags.isEmpty()) {
List<Fragment> childFragments = getChildFragmentManager().getFragments();
if (childFragments != null && !childFragments.isEmpty()) {
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
for (Fragment childFragment : childFragments) {
if (childFragment != null) {
if (childFragmentTags.contains(childFragment.getTag())) {
fragmentTransaction.remove(childFragment);
@flashfoxter
flashfoxter / NoOverscrollSwipeRefreshLayout.java
Created May 17, 2018 14:12 — forked from felipecsl/ NoOverscrollSwipeRefreshLayout.java
Modified Android SwipeRefreshLayout that does not move down the content view on swipe down (no overscroll)
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@flashfoxter
flashfoxter / GridInsetDecoration.java
Created May 25, 2018 17:20 — forked from UweTrottmann/GridInsetDecoration.java
RecyclerView grid spacing decoration for use with GridLayoutManager.
/*
* Copyright 2015 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software