Skip to content

Instantly share code, notes, and snippets.

💀
🌷

Lucas AgtLucas

💀
🌷
Block or report user

Report or block AgtLucas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View console-function-names.js
const bypass = [
// function names to avoid logging
];
const collapsed = [
// function names to groupCollapsed
];
module.exports = function(babel) {
const { types: t } = babel;
const wrapFunctionBody = babel.template(`{
View console-function-names.js
const bypass = [
// function names to avoid logging
];
const collapsed = [
// function names to groupCollapsed
];
module.exports = function(babel) {
const { types: t } = babel;
const wrapFunctionBody = babel.template(`{
@AgtLucas
AgtLucas / grab-the-city.swift
Last active Sep 17, 2019 — forked from TheAlienMann/Grab The City
"Grab The City" is a challenge that wants you to extract the name of the city in a given sentence which the name is wrapped in a pair of square brackets in the end of the sentence.
View grab-the-city.swift
func grabCity(_ str: String) -> String {
// the commented line below (the regex to be exact) gets just the last word! which is wrong, my fault though, i didn't read the challenge corectly!
// let regex = try! NSRegularExpression(pattern: "(\\w+)(?!.*\\w)", options: [])
// the regex below get every matches in the sentence that is being wrapped in a pair of square brackets.
let regex = try! NSRegularExpression(pattern: "(?<=\\[)(.+?)(?=\\])", options: [])
// the "result" below is of type NSTextCheckingResult which is an array, since the challenge askes for the last match, and i couldn't get the last match through the regex, i ened up gtting the last match via the "last" item in the array.
let result = regex.matches(in: str, options: [], range: NSRange(location: 0, length: str.count)).last
/*
// from line 11 to 18, is an alternative for getting the matches out of the result array, since it is an array (of type NSTextCheckingResult) you can iterate thtough it (loop though it)
// you can use each o
@AgtLucas
AgtLucas / 1.md
Created Jul 6, 2019 — forked from sw-yx/1.md
Learn In Public - 7 opinions for your tech career
View 1.md

1. Learn in public

this essay has been updated on my personal site, together with a followup on how to get started

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos or Twitch streams. Start a newsletter. Draw cartoons (people loooove cartoons!). Whatever your thing is, make the thing you wish you had found when you were learni

View ContentView.swift
//
// ContentView.swift
// BreatheUI WatchKit Extension
//
// Created by Joel Bernstein on 6/24/19.
// Copyright © 2019 Joel Bernstein. All rights reserved.
//
import SwiftUI
View profilevideo.sh
#! /usr/bin/env bash
# Requirements:
# - `primitive` @ https://github.com/fogleman/primitive,
# - `imagemagick` @ http://www.imagemagick.org/script/index.php,
# - `ffmpeg` @ https://ffmpeg.org/
# Make sure your input photo is named `input.jpg` (variable support later!)
# keep yo folder neat
View safari-ripper.html
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA
View a-redux-story.md

A Redux Story

Developer: "Doo Doo Doo... Working on the new Redux rewrite. Gotta write some fetch actions..."

FETCH_USERS -> function fetchUsersAction() {...}
FETCH_PAGES -> function fetchPagesAction() {...}
FETCH_FRIENDS -> function fetchFriendsAction() {...}
FETCH_GROUPS -> function fetchGroupsAction() {...}
FETCH_EVENTS -> function fetchEventsAction() {...}
@AgtLucas
AgtLucas / music.md
Created May 20, 2018 — forked from staltz/music.md
coding music
View music.md

Not for everyone. Each programmer has their own appreciation of what is good coding music.

For when I need to think deep, debug something, or design

(From most influential to least)

@AgtLucas
AgtLucas / prepack-gentle-intro-1.md
Created May 9, 2018 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1
View prepack-gentle-intro-1.md

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
You can’t perform that action at this time.