Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tcodes0's full-sized avatar
💭
What's happening?

Thomazella Ribeiro tcodes0

💭
What's happening?
View GitHub Profile
@Rafael-Ramblas
Rafael-Ramblas / file-extension-to-language.json
Last active September 6, 2023 16:14
This gist maps all the file extensions to supported monaco editor languages. This is based on monaco docs and github's language to extension map.
{
"_coffee": "coffeescript",
"_js": "javascript",
"adp": "tcl",
"al": "perl",
"ant": "xml",
"aw": "php",
"axml": "xml",
"bash": "shell",
"bats": "shell",
@barklund
barklund / fetchWeather.js
Created January 27, 2021 16:23
Return best weather service that answers within a timed limit
function fetchWeather(services, timeout) {
let bestData = null;
const controllers = services.map(() => new AbortController());
const cancelFrom = index => controllers.slice(index).map(c => c.abort());
const fetches = services.map((url, index) =>
fetch(url, {signal: controller[index].signal})
.then((res) => {
bestData = res;
cancelFrom(index+1);
return res;
@ybiquitous
ybiquitous / skip-ci-on-actions.yml
Last active February 9, 2021 10:11
How to "[skip ci]" on GitHub Actions
# See also:
# - https://github.com/actions/runner/issues/774
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#push-event-push
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: "[skip ci]" on Actions
on: [push, pull_request]
const GridCard = styled.div`
flex: 1;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
grid-gap: 15px 10px;
`;
@ThisIsMissEm
ThisIsMissEm / Post-checkout-hook.js
Last active October 2, 2020 16:57
The only post-checkout git hook I'll agree with
#! /usr/bin/env node
/**
* This file does not use typescript as it's run before you've necessarily run `yarn install`
* As such, we can only use built-in modules here.
*/
function main() {
let [
// Arguments from the githook: https://git-scm.com/docs/githooks#_post_checkout
@sibelius
sibelius / NativeModules.js
Created December 3, 2019 20:49
react-native mock with SettingsManager
jest.mock('react-native/Libraries/BatchedBridge/NativeModules', () => ({
AlertManager: {
alertWithArgs: jest.fn(),
},
AsyncLocalStorage: {
multiGet: jest.fn((keys, callback) =>
process.nextTick(() => callback(null, [])),
),
multiSet: jest.fn((entries, callback) =>
process.nextTick(() => callback(null)),
@j33ty
j33ty / print-memory.go
Created May 22, 2019 20:54
Go print current memory
package main
import (
"runtime"
"fmt"
"time"
)
func main() {
// Print our starting memory usage (should be around 0mb)
@foxyblocks
foxyblocks / ClickBoundary.jsx
Last active August 4, 2018 22:02
ClickBoundary react component implementation used inside the Bugsnag dashboard.
// Author: Christian Schlensker for Bugsnag.
// @flow
import { omit } from 'lodash';
import * as React from 'react';
// Creates a React context to track track the tree of ClickBoundaries down the component hierarchy.
const NodeContext = React.createContext();
type Props = {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],