Skip to content

Instantly share code, notes, and snippets.

View JoseRFJuniorLLMs's full-sized avatar
🎯
Focusing

Jose RF Junior JoseRFJuniorLLMs

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
import math
crimes=[(5,4), (6,3), (5,3), (7,3)]
phi=5
f, g= 2, 2
b=3
a=0
for j in range(10):
for i in range(10):
@letanure
letanure / estados-cidades.json
Last active July 10, 2024 01:23
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@robhudson
robhudson / lsCache.js
Last active December 14, 2015 16:09
caching and localStorage
var lsCache = function() {
var TIMEOUT_DEFAULT = 60;
var self = {
set: function(key, val, timeout) {
var timeout = parseInt(timeout, 10) || TIMEOUT_DEFAULT;
var now = Math.round(new Date().getTime() / 1000);
localStorage.setItem(key, val);
localStorage.setItem(key + '.timeout', now * timeout);
},
@jexp
jexp / graph_gist_template.adoc
Last active February 22, 2024 17:29 — forked from cheerfulstoic/graph_gist_template.adoc
CHANGEME: GraphGist Template. Fork to make your own, view source to see instruction comments

REPLACEME: TITLE OF YOUR GRAPHGIST

Introduction

// taken from Tutorial: Creating an Angular2 Autocomplete by Leonardo Jines
// http://4dev.tech/2016/03/tutorial-creating-an-angular2-autocomplete/#comment-1609
import {Component, ElementRef} from 'angular2/core';
@Component({
selector: 'my-app',
host: {
'(document:click)': 'handleClick($event)',
},
@fabiogoll
fabiogoll / bo.ts
Last active December 1, 2018 01:31
[Angular2] Implementação da Paginação no projeto
import {Paginacao, PaginacaoRequest} from "../utils/paginacao";
buscarClientePorFilial(filialId: number, pr: PaginacaoRequest): Promise<Paginacao> {
var self = this;
return new Promise<Paginacao>((resolve, reject) => {
var resposta: Resposta = new Resposta(TipoErro.ERROR, "Erro na busca de clientes!");
if (filialId === 0) {
resposta.motivo.push("Código da filial não pode ser nula!");
reject(resposta);
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "https://api.api.ai/v1/";
import numpy as np
import matplotlib.pyplot as plt
class MotionModel():
def __init__(self, A, Q):
self.A = A
self.Q = Q
(m, _) = Q.shape
package main
import (
"context"
"fmt"
"mime"
"net/http"
"os"
"os/signal"
"path/filepath"
@mkaranasou
mkaranasou / pyspark_simple_read_text_file.py
Last active October 4, 2019 14:16
Use pyspark to read a text file and identify a term
from pyspark import SparkConf
from pyspark.sql import SparkSession, functions as F
conf = SparkConf()
# optional but it would be good to set the amount of ram the driver can use to
# a reasonable (regarding the size of the file we want to read) amount, so that we don't get an OOM exception
conf.set('spark.driver.memory', '6G')
# create a spark session - nothing can be done without this:
spark = SparkSession.builder \