Skip to content

Instantly share code, notes, and snippets.

View salacoste's full-sized avatar
💭
Let's play Frontend

Ivan D salacoste

💭
Let's play Frontend
View GitHub Profile
@salacoste
salacoste / gistGitAdvice_01.md
Last active February 26, 2023 20:58
How remove last one (or any number) commits

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

`` git reset --hard HEAD^

@salacoste
salacoste / requests.js
Created January 17, 2023 16:07 — forked from yoav-lavi/requests.js
request module for Scriptable
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
module.exports = {
post: async ({ url, body, headers = {} }) => {
const request = new Request(url);
request.body = JSON.stringify(body);
request.method = methods.post;
request.headers = {
...defaultHeaders,
@salacoste
salacoste / facebook-wca-standard-events.html
Created July 8, 2021 01:01 — forked from danielmcclure/facebook-wca-standard-events.html
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>