Skip to content

Instantly share code, notes, and snippets.

View bboydflo's full-sized avatar
🎯
be nice 👍

Florin Cosmin bboydflo

🎯
be nice 👍
  • Denmark
View GitHub Profile
@bboydflo
bboydflo / redux_setup.md
Created May 30, 2018 06:04 — forked from kiok46/redux_setup.md
Redux, store, actions and reducers setup along with explanation.

Redux Setup

Implementation of redux inside any react.js or react-native application,

  • we will create an instance of the redux store.
  • We are going to create a provider tag from react redux library
  • Then render that provider tag passing in the store as a prop, then any child component to this provider tag will have access to this store through the context system inside of react.
  • import { Provider } from ‘react-redux’; // In main.js
  • to create a store create one in a separate folder.
@bboydflo
bboydflo / requestIdleCallback.js
Created January 19, 2018 13:55 — forked from paullewis/requestIdleCallback.js
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* 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
@bboydflo
bboydflo / index.html #html #webdev
Last active November 21, 2019 12:49 — forked from tjmonsi/index.html
My Opinionated Landing Page example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Viewport -->
<meta name="viewport" content="width=device-width, minimum-scale = 1.0, initial-scale = 1.0, maximum-scale = 5.0, user-scalable=yes">
<title>Title of the Page</title>
@bboydflo
bboydflo / getIOSVersion.js
Created June 9, 2017 12:20 — forked from to4iki/getIOSVersion.js
Get iOS version via javascript
class Semver {
constructor(major, minner, patch) {
this.major = major;
this.minner = minner;
this.patch = patch;
}
toString() {
return `${this.major}_${this.minner}_${this.patch}`;
}
@bboydflo
bboydflo / Bluetooth.java
Last active November 21, 2019 12:49 — forked from cnbuff410/Bluetooth.java
Legacy Bluetooth(pre 4.0) connection code for Android #android #java #bluetooth
package xx.xx.xx.xx;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.UUID;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
@bboydflo
bboydflo / 0_reuse_code.js
Created September 26, 2016 10:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bboydflo
bboydflo / .babelrc
Last active December 2, 2019 14:16 — forked from bdchauvette/.babelrc
[Minimal node and babel boilerplate] minimal node and babel boilerplate #webdev
{
"presets": [ "es2015" ]
}
@bboydflo
bboydflo / ios-version.js
Created May 31, 2016 07:24 — forked from Craga89/ios-version.js
JavaScript iOS version detection
/*
* Outputs a float representing the iOS version if user is using an iOS browser i.e. iPhone, iPad
* Possible values include:
* 3 - v3.0
* 4.0 - v4.0
* 4.14 - v4.1.4
* false - Not iOS
*/
var iOS = parseFloat(
@bboydflo
bboydflo / Default (OSX).sublime-keymap
Created May 3, 2016 16:46 — forked from radum/Default (OSX).sublime-keymap
Sublime Text 3 Configuration Files
[
{ "keys": ["ctrl+pagedown"], "command": "next_view" },
{ "keys": ["ctrl+pageup"], "command": "prev_view" }
]

If you are using backbone (and backbone.marionette) in a browserify managed project, you will likely run into issues with underscore (at least if you manage your dependencies with npm). Each package, that has underscore as a dependency, will require its own version of underscore (making your bundle file contain multiple versions of underscore). Back in the days, you could shim backbone and underscore like:

browserify({
	shim: {
		'underscore': {
			path: './node_modules/underscore/underscore.js',
			exports: '_'
 },