Skip to content

Instantly share code, notes, and snippets.

View lenilsonjr's full-sized avatar
😵‍💫
ye

lenilsonjr lenilsonjr

😵‍💫
ye
View GitHub Profile
@lenilsonjr
lenilsonjr / Daily Note.md
Created October 8, 2023 21:51
Weekly and Daily Note Templater Template

<% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>

🗓️ [[Personal/Weekly Notes/<% moment(tp.file.title).format("gggg-[W]WW") %>|<% moment(tp.file.title).format("[Week] WW [of] gggg") %>]]

[[Personal/Daily Notes/<% fileDate = moment(tp.file.title, 'YYYY-MM-DD').subtract(1, 'd').format('YYYY-MM-DD') %>|<< 🌞 Yesterday]] | [[Personal/Daily Notes/<% fileDate = moment(tp.file.title, 'YYYY-MM-DD').add(1, 'd').format('YYYY-MM-DD') %>|🌞 Tomorrow >>]]


🎯 Today's big three

@lenilsonjr
lenilsonjr / application_controller.rb
Created August 1, 2023 20:11
Cloudflare Turnstile on Rails
class ApplicationController < ActionController::Base
# ...
def protect_with_cf_turnstile!
token = params['cf-turnstile-response']
ip = request.remote_ip
secret = Rails.application.credentials.dig(:cloudfare, :turnstile, :secret_key) #Ur site secret
# Prepare the form data
body = { :secret => secret, :response => token, :remoteip => ip }
@lenilsonjr
lenilsonjr / keybase.md
Last active October 15, 2021 05:57
keybase.md

Keybase proof

I hereby claim:

  • I am lenilsonjr on github.
  • I am lenilsonjr (https://keybase.io/lenilsonjr) on keybase.
  • I have a public key ASA5uj6qjoqUPS71_tGr0BXUkfM6fP_3R8KQxPWxvYepQQo

To claim this, I am signing this object:

@lenilsonjr
lenilsonjr / unfollowed_full_names.txt
Created April 7, 2018 23:54
Everyone I unfollowed after using KrauseFx's script
rhysbeingsocial (Rhys Adams): 🛠 Maker - Working on Squeek.
NowNowNow (sites with /now): to add yours, email me:
sivers (Derek Sivers): Writer, programmer, avid student of life. Please email instead of tweet at me : https://t.co/PgECJhvlTq
waitbutwhy (Tim Urban): http://t.co/ME98gSGRKS
kemyd (Kemyd): Head of Technology @ Flying Bisons
getaclue_1 (Alex Kluew 🇨🇦): Software Engineer, EIT - I read your beautifully tracked emails using plain text - https://t.co/3hnYhR2cFd – https://t.co/7fYyjc9gKc – https://t.co/KSxKT4cHgJ
pasql (Pasquale D'Silva): I make @uselightbox. I hang out on @screenhole. ✨ Animator & Software Designer.
bukinoshita (Bu Kinoshita): full-time open sourcerer · nomad
selfcare_bot (Self Care Bot): An hourly reminder to look after yourself. Created by @AlaynaMCole via @HornedLlama for Self Care Jam 2016.
IndieHackers (Indie Hackers): Get inspired! Real stories, advice, and revenue numbers from the founders of profitable businesses ⚡ by @csallen and @channingallen at @stripe
@lenilsonjr
lenilsonjr / bounty.js
Last active December 21, 2017 10:53
Keybase WarpWallet Bounty Challenge
function randomString(length, chars) {
var result = '';
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
return result;
}
function searchWallet() {
pass = randomString(8,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
console.log('Trying w/ ' + pass);
@lenilsonjr
lenilsonjr / allow-rest-api-cors.php
Created July 26, 2017 19:06
Allow CORS on WP-API
add_action( 'rest_api_init', 'handle_preflight' );
function handle_preflight() {
header("Access-Control-Allow-Origin: *"); //Pay attention
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Headers: x-requested-with,x-wp-nonce");
if ( 'OPTIONS' == $_SERVER['REQUEST_METHOD'] ) {
status_header(200);