Skip to content

Instantly share code, notes, and snippets.

View YOEL311's full-sized avatar

Yoel Naki YOEL311

  • Abra
  • Ashdod
View GitHub Profile
@BrianJVarley
BrianJVarley / AppStrings.js
Last active December 10, 2021 07:26
Mocking react-native-localization package in jest spec
// ES6 module syntax
import LocalizedStrings from 'react-native-localization';
let AppStrings = new LocalizedStrings({
'en-US': {
settingMenuOptionOne: 'Centimeters ({0})',
},
en: {
settingMenuOptionOne: 'Centimeters ({0})',
},
@sidferreira
sidferreira / RootNavigator.js
Last active February 8, 2022 13:42
React Navigation + MobX Integration (React Native Based)
// App/RootNavigator.js
import { StackNavigator } from 'react-navigation'
import AScreen from '../Containers/AScreen'
import BScreen from '../Containers/BScreen'
const RootNavigator = StackNavigator(
{
A: { screen: AScreen },
@hilfritz
hilfritz / gist:80449f31db05c3e393e4da84076feb24
Created November 16, 2017 03:01
Java: convert Map to Bundle
public Bundle convertMapToBundle(Map<String, String> data){
Bundle bundle = new Bundle();
for (Map.Entry<String, String> entry : data.entrySet()) {
bundle.putString(entry.getKey(), entry.getValue());
}
return bundle;
}
@evdokimovm
evdokimovm / index.js
Created June 19, 2016 14:10
JavaScript Convert Radians to Degrees and Degrees to Radians
// Convert from degrees to radians.
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
}
Math.radians(90); // 1.5707963267948966
// Convert from radians to degrees.
Math.degrees = function(radians) {
return radians * 180 / Math.PI;
}
@pwlin
pwlin / gist:8a0d01e6428b7a96e2eb
Last active April 26, 2024 11:16
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.
@carcinocron
carcinocron / debugger pause beforeunload
Last active April 25, 2024 16:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)