Skip to content

Instantly share code, notes, and snippets.

View thompsonemerson's full-sized avatar
:octocat:

Emerson Thompson thompsonemerson

:octocat:
View GitHub Profile
import { createContext, ReactNode, useEffect, useState } from 'react'
type Theme = 'light' | 'dark';
type ThemeContextProviderProps = {
children: ReactNode;
}
type ThemeContextType = {
theme: Theme;
@alisonmonteiro
alisonmonteiro / form.js
Last active May 29, 2018 17:10
Wordpress Ajax Example
const url = '/wp-admin/admin-ajax.php'
const data = {
action: 'custom_action',
token: document.querySelector('[name="token"]').value,
name: document.querySelector('[name="name"]').value
}
customRequest(url, data) // ...
@NigelEarle
NigelEarle / Knex-Setup.md
Last active March 15, 2025 16:49
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@callmeloureiro
callmeloureiro / comoSerChatoNoWhatsapp.js
Last active September 23, 2024 19:29
Como fazer alguém te responder no whatsapp
/*
Hoje iremos MUDAR a vida da pessoa que não te responde no whatsappp...
Que tal enviar mensagens pra ela até obter uma resposta?!
Sensacional não acha?! Mas, somos devs, correto?! Então vamos automatizar esse paranauê!
Para utilizar:
- Abra o web.whatsapp.com;
- Selecione a conversa que você quer;
- Abra o console e cole o código que está no gist;
@mikeal
mikeal / r2.js
Last active April 6, 2025 09:18
HTTP Client Comparison
const r2 = require('r2')
let doJsonThing = async (path, propname) => {
let res = await r2(`http://api.com${path}`).json
return res[propname]
}
{
"code": 200,
"status": "Ok",
"copyright": "© 2016 MARVEL",
"attributionText": "Data provided by Marvel. © 2016 MARVEL",
"attributionHTML": "<a href=\"http://marvel.com\">Data provided by Marvel. © 2016 MARVEL</a>",
"etag": "753881c8c91423f73b142fce823cd81b44dce62a",
"data": {
"offset": 0,
"limit": 25,
@wkwiatek
wkwiatek / app-1.spec.ts
Last active December 17, 2021 01:52
Angular 2 test snippets for Angular final version. Codebase for https://developers.livechatinc.com/blog/category/programming/angular-2/
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
http://appcamp.io/courses/user-interface/layout-simple

http://thompsonemerson.github.io/ionic-collection/


## ionic examples
ionic start ionicApp
ionic start blankApp blank
ionic start tabsApp tabs
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active December 14, 2025 15:38
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@ngpestelos
ngpestelos / remove-docker-containers.md
Last active October 8, 2025 18:58
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)