Skip to content

Instantly share code, notes, and snippets.

View ricardocanelas's full-sized avatar
🦈

Ricardo Canelas ricardocanelas

🦈
View GitHub Profile
@tophtucker
tophtucker / .DS_Store
Last active July 20, 2025 18:05
Measure text
@cowboy
cowboy / mock-axios.js
Last active November 23, 2024 01:39
axios mocking via interceptors
import axios from 'axios'
let mockingEnabled = false
const mocks = {}
export function addMock(url, data) {
mocks[url] = data
}
@julienV
julienV / gist:f19aebcb32ef2b02af500f5d7fb7bc8a
Last active March 29, 2022 11:43
docker-compose.yml for php 5.4
version: '2'
services:
web:
image: "alterway/php:5.4-apache"
ports:
- "8080:80"
volumes:
- .:/var/www/html
environment:
PHP_php5enmod: 'memcached xdebug mysql mysqli pdo_mysql gd'
@sibelius
sibelius / Example.js
Last active April 23, 2018 23:44
Formik TextInput example
class ExampleForm extends React.Component<Props> {
render() {
return (
<View>
<TextInput name={'email'} />
</View>
);
}
}
@lyudmil-mitev
lyudmil-mitev / index.html
Last active May 2, 2024 13:41
CSS Transform Scale element to fit its parent
<html>
<head>
<title>CSS Transform Scale element to fit its parent</title>
<script src="scale2fit.js"></script>
<link rel="stylesheet" href="style.css"/>
<script>
(function(window) {
function main() {
const margin = 10;
requestAnimationFrame(function fitToParentOnResize() {
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>
@vinicius73
vinicius73 / 0-contribua-.md
Last active August 23, 2025 16:32
Guia de referencias sobre estudo de JavaScript

Contribua

Se você quiser adicionar mais algum tópico deixe seu comentário, o objetico é facilitar para os iniciantes ou aqueles que buscam dominar JavaScript, quais tópicos são importantes para dominar JavaScript.

São tópicos para quem sabe o minimo de JavaScript (declarar variáveis), a ordem em que eles aparecem são por importância para o dominio como um todo. Mesmo que você já tenha experiência com JS, recomendo que leia os links de cada tópico para fortalecer suas bases teóricas e ter um comportamento mais profundo da linguagem.

Lista originalmente criada e compilada por Vinicius Reis

//import mocked RNFirebase
import RNFirebase from 'react-native-firebase'
//reset mocks
beforeEach(() => {
RNFirebase.reset()
})
//set mocked data
const ref = RNFirebase.firebase.database().ref('users/')
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2026 08:54
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@davidfurlong
davidfurlong / JSON.stringify-replacer-sort-keys.js
Last active March 6, 2025 02:17
JSON.stringify replacer function for having object keys sorted in output (supports deeply nested objects)
// Spec http://www.ecma-international.org/ecma-262/6.0/#sec-json.stringify
const replacer = (key, value) =>
value instanceof Object && !(value instanceof Array) ?
Object.keys(value)
.sort()
.reduce((sorted, key) => {
sorted[key] = value[key];
return sorted
}, {}) :
value;