This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (top.location != self.location) | |
top.location = self.location; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = getNumber('23.7'); // f = 23.7 | |
//var f = getNumber(23.7); // f = 23.7 | |
//var f = getNumber('23.7 px'); // f = 23.7 | |
//var f = getNumber('23.7 %'); // f = 0.237 | |
function getNumber(input) { | |
if( typeof input === 'string' && input.slice(-1) === '%') { | |
input = parseFloat(input.slice(0,-1))/100; | |
} else { | |
input = parseFloat(input); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Zlogin by Cyril F [Ezio] | |
echo " | |
_|_|_|_| _| | |
_| _|_|_|_| _|_| | |
_|_|_| _| _| _| _| | |
_| _| _| _| _| | |
_|_|_|_| _|_|_|_| _| _|_| " | |
echo -e "\e[0;35m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Save your We Are Hunted playlist | |
// Download all your We Are Hunted tracks infos in a JSON file | |
// by Cyril F (github.com/cyrilf) | |
// Instructions | |
// | |
// Go to wearehunted.com | |
// Change the USERNAME below by your username or email. | |
// Copy and paste the following code into your javascript | |
// console. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* hasNestedProperties check if an object has the nested | |
* properties passed in params | |
* | |
* @param {Object} obj object we want to test | |
* @param {String} properties nested property we want | |
* @return {Boolean} either the object has these | |
* nested properties or not | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* BjyAuthorize Module (https://github.com/bjyoungblood/BjyAuthorize) | |
* | |
* @link https://github.com/bjyoungblood/BjyAuthorize for the canonical source repository | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace BjyAuthorize\Provider\Identity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Improvement proposal | |
$IncludedByStateFilter.$inject = ['$state']; | |
function $IncludedByStateFilter($state) { | |
var includesFilter = function (state, params, options) { | |
return $state.includes(state, params, options); | |
}; | |
includesFilter.$stateful = true; | |
return includesFilter; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by https://github.com/MicheleBertoli/react-automata/blob/d9128bebe30df83c41bff4ed806549241fcf3b04/src/withStatechart.js | |
// Example of how to use a custom life-cycle method for a wrapped component | |
import React from 'react' | |
const isStateless = Component => | |
!(Component.prototype && Component.prototype.isReactComponent) | |
const withSomething = Component => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Utility function to get access nested object properties securely | |
// | |
// Usage: | |
// const invoiceName = get(account, "user.invoiceAddress.name") | |
// | |
// Instead of: | |
// const invoiceName = (account && account.user && account.user.invoiceAddress && account.user.invoiceAddress.name) || null | |
// https://stackoverflow.com/a/23809123/1410020 | |
const get = (obj, key) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From: https://stackoverflow.com/questions/50963215/can-we-specify-a-generic-getter-on-an-object-in-javascript | |
// Allows you to access nested property (1 level) without the need to to safety check | |
const properties = { email: { title: "Email", value: "[email protected]" } } | |
const proxy = new Proxy(properties, { | |
get: (target, prop) => (prop in target) ? target[prop] : {}, | |
}) | |
// or |
OlderNewer