Skip to content

Instantly share code, notes, and snippets.

View Minasokoni's full-sized avatar
:octocat:

Robert Barnwell Minasokoni

:octocat:
View GitHub Profile
@Minasokoni
Minasokoni / leetcode.js
Last active February 26, 2021 16:14
Telegram Exercise
function compareArray(a, b) {
// check if arrays, check length, check index match
return Array.isArray(a) &&
Array.isArray(b) &&
a.length === b.length &&
a.every((val, index) => val === b[index]);
}
function wrapText(words, maxLength) {
const result = [];
@Minasokoni
Minasokoni / reset.css
Created October 17, 2019 16:41
Reset.css
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
ul[class],
ol[class] {
@Minasokoni
Minasokoni / ba-detach.js
Created October 11, 2019 22:25 — forked from cowboy/ba-detach.js
JavaScript detach: detach a node from the DOM, optionally reattaching it when done.
/*!
* JavaScript detach - v0.2 - 5/18/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
function detach(node, async, fn) {
@Minasokoni
Minasokoni / adminer_setup.sh
Created August 12, 2019 05:40 — forked from zloynemec/adminer_setup.sh
Secure adminer nginx setup
# Secure adminer setup
# Author Taras Kozlov
# download adminer to separate directory
mkdir -p /var/www/admin
cd /var/www/admin
wget http://www.adminer.org/latest.php -O adminer.php
echo '<?php phpinfo(); >' > info.php
sudo -i
@Minasokoni
Minasokoni / app.js
Created July 22, 2019 17:51 — forked from papandreou/app.js
graphqlInMultipartFormDataMiddleware.js
const { graphqlExpress } = require('graphql-server-express');
const graphQlTools = require('graphql-tools');
const schema = graphQlTools.makeExecutableSchema({
typeDefs: schemaText,
resolvers: {
Mutation: {
async uploadFiles(obj, { input }, req, info }) {
// ...
try {
@Minasokoni
Minasokoni / commits.vue
Created June 21, 2019 16:34 — forked from yyx990803/commits.vue
Vue examples comparisons in 2.x and function-based APIs
<template>
<div id="demo">
<h1>Latest Vue.js Commits</h1>
<template v-for="branch in branches">
<input type="radio"
:id="branch"
:value="branch"
name="branch"
v-model="currentBranch">
<label :for="branch">{{ branch }}</label>
@Minasokoni
Minasokoni / config.yml
Created February 28, 2019 15:54 — forked from ThiagoBarradas/config.yml
Auto rollback with circleci 2.0
## 1) GENERATE AN API TOKEN (https://circleci.com/gh/<gh-user>/<gh-repo-name>/edit#api)
## 2) ADD ENV VAR WITH NAME "CIRCLE_API_TOKEN" WITH PREVIOUS GENERATED TOKEN
version: 2
jobs:
build:
machine: true
steps:
- run:
name: Build App
@Minasokoni
Minasokoni / gist:e54e4a89f4129a4436e0f61fc05441c9
Created December 7, 2018 00:21 — forked from atadams/gist:3085530
Terminal: Defaults Write
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Disable the “Are you sure you want to open this application?” dialog
@Minasokoni
Minasokoni / DetectAdBlock.js
Created September 10, 2018 06:29 — forked from hotdang-ca/DetectAdBlock.js
Detect AdBlockers from a React Component
/**
*
* Detect Ad Blockers
*
* Copyright (c) 2017 James Robert Perih
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
@Minasokoni
Minasokoni / .block
Created August 15, 2018 21:21 — forked from mtranggit/.block
Make d3 responsive
license: mit