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'
@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.
@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@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
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@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

@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
@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:

@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 / 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)