Skip to content

Instantly share code, notes, and snippets.

View ManUtopiK's full-sized avatar
:octocat:
Ready to code.

Emmanuel Salomon ManUtopiK

:octocat:
Ready to code.
View GitHub Profile
@ManUtopiK
ManUtopiK / manu-vivaldi.css
Created September 11, 2016 00:36
My vivaldi custom theme
/**
* Import webfont icons from font awesome
*/
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css);
/**
* #header
*/
@ManUtopiK
ManUtopiK / index.html
Last active November 3, 2016 17:31
Glitch Effect
<section id="intro-frame">
<div id="call2action">
<div class="game-title">
<span>Can You</span><br>
<div class="align-box">
<span class="emphasized glitch" data-text="hack">
Hack
</span>
<span class="small">the</span><br>
</div>
@ManUtopiK
ManUtopiK / gist:bc5d1b2e5a1d8f32284d23a7b3512f38
Last active April 25, 2017 19:20
Hack to detect if chrome devtools is open
var checkStatus;
var element = new Image();
// var element = document.createElement('any');
Object.defineProperty(element, 'id', {
get:function() {
checkStatus='on';
throw new Error("This is a hack to check If chrome Devtools is open. Pay no attention.............................................................................................................");
}
});
Sub Csv()
Dim Fichier As Variant, Chaine As String, T(), LDéb As Long, TSpl() As String, L As Long, C As Long, Z As String
ReDim T(1 To 5000, 1 To 9)
LDéb = 2
ChDrive ThisWorkbook.Path: ChDir ThisWorkbook.Path
Fichier = Application.GetOpenFilename("Fichier CSV (*.csv), *.csv")
If VarType(Fichier) <> vbString Then Exit Sub
Open Fichier For Input As #1
Line Input #1, Chaine ' ignore la ligne de titres du csv
Do While Not EOF(1)
@ManUtopiK
ManUtopiK / style.css
Created October 4, 2017 19:15
CSS collapsible block
.wrap-collabsible {
margin-bottom: 1.2rem 0;
}
input[type='checkbox'] {
display: none;
}
.lbl-toggle {
display: block;
@ManUtopiK
ManUtopiK / header.vue
Last active December 10, 2017 14:24
Brightness reverted color computed. Vue component.
<template>
<div class="header" :style="style">
</div>
</template>
<script>
export default {
name: 'Header',
props: {
@ManUtopiK
ManUtopiK / fetchData.vue
Created April 5, 2018 00:06
Vue fetch component
<template>
<div id="app" class="min-h-screen font-sans bg-grey-lighter">
<div class="container mx-auto max-w-md p-6">
<fetch-data url="https://api.github.com/orgs/vuejs/repos">
<div slot="loading">Loading repositories...</div>
<div slot-scope="{ response: repos }">
<div v-for="repo in repos" class="shadow-md bg-white p-6 mb-6 rounded">
<div class="flex mb-4">
<a :href="repo.html_url" class="text-blue no-underline"><h2 class="text-lg mr-4">{{ repo.full_name }}</h2></a>
@ManUtopiK
ManUtopiK / clean-graphql.js
Last active May 5, 2024 20:11
Clean graphql response : Remove edges, node and __typename from graphql response
/**
* Remove edges, node and __typename from graphql response
*
* @param {Object} input - The graphql response
* @returns {Object} Clean graphql response
*/
const cleanGraphQLResponse = function(input) {
if (!input) return null
const output = {}
const isObject = obj => {
@ManUtopiK
ManUtopiK / plugins.js
Created August 27, 2019 14:27
Import multiple svg in nuxt
import Vue from 'vue'
import forEach from 'lodash/forEach'
const icons = require.context('~/icons', false, /[A-Z]\w+\.(svg)$/)
forEach(icons.keys(), (fileName) => {
const iconConfig = icons(fileName)
const iconName = fileName.split('/').pop().split('.')[0]
Vue.component(iconName, iconConfig.default || iconConfig)
})
@ManUtopiK
ManUtopiK / ratelimit.js
Last active July 3, 2022 09:16
rate limiting javascript generator
async function* rateLimit(limit, time) {
let count = 0;
while(true) {
if(count++ >= limit) {
await delay(time);
count = 0;
}
yield; // Let's execute next code
}
}