Skip to content

Instantly share code, notes, and snippets.

View BruhKofi's full-sized avatar
🐿️
eating nuts

Victor BruhKofi

🐿️
eating nuts
View GitHub Profile
@BruhKofi
BruhKofi / detectAdsLoaded.js
Created July 5, 2019 09:05 — forked from badcrocodile/detectAdsLoaded.js
Detect when Google Ads API is loaded and when ads are ready and loaded in the DOM
window.googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(detectAdLoad);
function detectAdLoad() {
/**
* NOTE: This function depends on the ad slot ID (var targetSlot). If this changes, this function will break
*
* Patched together using documentation at https://developers.google.com/doubleclick-gpt/reference
const MissinNum = () => {
const myArray = [2, 4, 1, 5]
const N = 5
let Sum = N*(N+1)
Sum = Sum/2
sumCount = 0
for (let i = 0; i < (myArray.length); i++) {
sumCount += myArray[i]
const CompareArrays = () => {
var arrayA = [1, 2, 3, 4, 5];
var arrayB = [1, 2, 4, 4, 4];
var totalmatches = 0;
if (arrayA.length == arrayB.length) {
for (i = 0; i < arrayA.length; i++) {
for (j = 0; j < arrayB.length; ++j) {
if (arrayA[i] == arrayB[j]) {
totalmatches++;
//Das Original
const Original = () => {
const array = [5, 9, 3, 19];
let x = 0;
for (let i = 0; i < array.length; i++) {
for (let j = 0; j < array.length; j++) {
// const notValue = array[i] - array[j]
const value = Math.abs(array[i] - array[j]);
function Node(data) {
this.data = data;
this.next = null;
}
function LinkedList() {
this.head = null;
this.tail = null;
this.length = 0;
}
@BruhKofi
BruhKofi / sagas.js
Last active February 27, 2018 18:45
//How I am making the api call
export function fetchAPI(url, method = 'GET', body = null, isBlob = false) {
let request;
if (method === 'POST') {
request = fetch(url, {
method,
body: isBlob ? body : JSON.stringify(body),
headers: {
'X-Parse-Application-Id': 'myAppId',
var directionsDisplay;
var directionsService;
var marker;
var geocoder;
var map;
var defaultCenter;
var infowindow;
var center;
var prefix;
var textfield;
@BruhKofi
BruhKofi / epyk-custom-head.html
Created January 18, 2018 01:16 — forked from billhance/epyk-custom-head.html
Epyk Custom Header Scripts for sharetribe
<script type="text/javascript">
(function(document){
function syncDatePickers(startDateNode, endDateNode) {
startDateNode.datepicker().on("changeDate", function(e) {
endDateNode.datepicker('setDate', new Date(e.target.value));
});
}
function changeLabelText(datePickerNode, text) {
datePickerNode.closest('div').css('width', '100%').find('label').text(text);
@BruhKofi
BruhKofi / Dockerfile
Created January 17, 2018 19:51 — forked from DakotaLMartinez/Dockerfile
Sharetribe Dockerfile
FROM ruby:2.3.4
MAINTAINER Sharetribe Team <team@sharetribe.com>
ENV REFRESHED_AT 2016-11-08
RUN apt-get update \
&& apt-get dist-upgrade -y
#
@BruhKofi
BruhKofi / .eslintrc
Created October 16, 2017 19:38 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names