Skip to content

Instantly share code, notes, and snippets.

View ciceropablo's full-sized avatar
🎧
Focusing

Cícero Santos ciceropablo

🎧
Focusing
View GitHub Profile
@ciceropablo
ciceropablo / settings.json
Last active November 9, 2023 19:36
My Visual Studio Code settings.
{
// CSS
"css.lint.unknownAtRules": "ignore",
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Dart
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,

Keybase proof

I hereby claim:

  • I am ciceropablo on github.
  • I am ciceropablo (https://keybase.io/ciceropablo) on keybase.
  • I have a public key ASCBMBVsjEnK8EjNVeTM_LTfgdk3BY7XQqNAo6yBzZK-fAo

To claim this, I am signing this object:

@ciceropablo
ciceropablo / get-wh-jpg.js
Created April 19, 2020 17:51
Simple script to get width and height from image.
const fs = require('fs');
fs.readFile('me.jpg', (err, data) => {
if (err) throw err;
let buf = Buffer.from(data).slice(4);
while(buf.length) {
const i = buf.readUInt16BE(0);
next = buf[i + 1];
@ciceropablo
ciceropablo / fetch-api.cljs
Last active October 8, 2019 16:39
Fetch API
(ns app.events
(:require
[clojure.walk :as walk]
[re-frame.core :as rf]))
(rf/reg-fx :fetch
(fn [{:keys [query variables on-error on-success]}]
(let [body (-> {:query query
:variables variables}
clj->js
@ciceropablo
ciceropablo / fibonacci.clj
Last active March 16, 2019 15:01
Fibonacci resolution in Clojure.
(defn fibonacci [n]
(if (< n 2) n
(+ (fibonacci (- n 1)) (fibonacci (- n 2)))))
(map #(-> % fibonacci prn) (range 1 11))
@ciceropablo
ciceropablo / armstrong-number.clj
Last active March 19, 2019 01:30
Armstrong number resolution in Clojure.
(ns armstrong-numbers
(:require
[clojure.string :as str]))
(defn pow [x n]
(if (zero? n) 1
(* x (pow x (dec n)))))
(defn num-str [n] (str n))
@ciceropablo
ciceropablo / fizz-buzz.clj
Last active March 16, 2019 15:01
Fizz Buzz resolution in Clojure.
(defn divisible?
[dividend divisor]
(zero? (mod dividend divisor)))
(defn fizzbuzz
[n]
(cond
(divisible? n 3) "fizz"
(divisible? n 5) "buzz"
(and (divisible? n 3) (divisible? n 5)) "fizz buzz"
# editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
git archive -o update.zip HEAD $(git diff --diff-filter=ACMRTUXB --name-only HASH-INICIAL HASH-FINAL)