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 / jquery.spin.js
Last active August 29, 2015 14:14 — forked from nzy/jquery.spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.

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: '_'
 },
@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" }
]
@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 / .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 / 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 / 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 / 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 / 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 / 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