Skip to content

Instantly share code, notes, and snippets.

View khaosdoctor's full-sized avatar
:shipit:
Always trying, never giving up

Lucas Santos khaosdoctor

:shipit:
Always trying, never giving up
View GitHub Profile
@elundmark
elundmark / apt_get_bashrc_aliases.sh
Created July 19, 2012 18:10
apt-get bashrc aliases collection
alias _sa='sudo apt-get'
alias _sai='sudo apt-get install'
alias _sar='sudo apt-get remove'
alias _sarp='sudo apt-get remove --purge'
alias _saa='sudo apt-get autoremove'
alias _saap='sudo apt-get autoremove --purge'
alias _sau='sudo apt-get update'
alias _sag='sudo apt-get upgrade'
alias _saug='sudo apt-get update && sudo apt-get upgrade'
alias _scaug='sudo apt-get update && sudo apt-get upgrade && sudo apt-get clean'
@khaosdoctor
khaosdoctor / insta_save.js
Created December 15, 2018 16:03
Saves all your saved images on instagram
Array.from($('#react-root > section > main > div > header + div + div + div > article > div > div').children).forEach(row => {
Array.from(row.children).forEach(async (image) => {
try {
const photoUrl = image.querySelector('a').getAttribute('href')
const response = await fetch(`https://instagram.com${photoUrl}`)
const responseText = await response.text()
const parser = new DOMParser()
const htmlDocument = parser.parseFromString(responseText, 'text/html')
const sharedData = JSON.parse(htmlDocument.querySelector('#react-root+script').innerText.replace('window._sharedData = ', '').replace('};', '}'))
const picData = sharedData.entry_data.PostPage[0] ? sharedData.entry_data.PostPage[0].graphql.shortcode_media : sharedData.entry_data
@ErickWendel
ErickWendel / youtube-video-analytics.js
Created September 16, 2021 20:00
Example of how to get video views from youtube
const YOUTUBE_KEY = "YOUR YOUTUBE KEY"
import axios = from 'axios';
function getVideoId(link) {
const videoId = link.match(/v=(?<videoId>.*)/)?.groups?.videoId
return videoId
}
async function getVideoViews(link) {
const videoId = getVideoId(link)
@ErickWendel
ErickWendel / linkedin-post-analytics-example.mjs
Last active July 22, 2022 12:00
Example of how to get post Analytics such as Views from a Linkedin post
// paste this file on a empty directory
// npm i axios
// You should go to your browser on Cookie session and get JSESSIONID and li_at from Linkedin Section
const JSESSIONID = 'YOUR JSESSIONID'
const liAT = 'YOUR li_at'
import axios from 'axios'
const headers = {
@ErickWendel
ErickWendel / gde-post-contribution.js
Last active March 8, 2023 13:02
Example of how to automate contribution submissions on GDE API
const axios = require('axios')
class GDEAPI {
constructor({ token }) {
this.token = token
}
async submitContributions(body) {
const headers = {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9",
@augustohp
augustohp / to-apple.md
Last active June 5, 2023 18:49
To: Apple

Apple,

You are a company I learned to love and hate. In that same order.

  • I love the way you try to reach excellence in everything you do
  • I hate the way you try to fuck everyone else who tries to do same

Things I (still) love

  • The MacBook (track pad) is a great piece of hardware, sadly it is not one-of-a-kind anymore. Even more sad is that all other (great) options do not try to hold you on all kind of accessories and stuff, although it still bearable for an old time customer.
@khaosdoctor
khaosdoctor / workingwithlucas-en-us.md
Last active October 1, 2023 21:46
Useful info when working with me

Working with Lucas

Creation Date: June 2020

Status: in progress

A collection of stuff that might come in handy when working with me

My personal philosophy:

@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active April 23, 2024 17:49
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions