Skip to content

Instantly share code, notes, and snippets.

Avatar
💤
Thinking ...

Ananda Dwi Ae misskecupbung

💤
Thinking ...
View GitHub Profile
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
View alert.sh
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active March 19, 2023 19:17
Git HowTo: revert a commit already pushed to a remote repository
View revert-a-commit.md

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@rxaviers
rxaviers / gist:7360908
Last active March 22, 2023 19:56
Complete list of github markdown emoji markup
View gist:7360908

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@gregrahn
gregrahn / tweet2csv.py
Created August 15, 2013 05:20
translate tweet json to a CSV file
View tweet2csv.py
#!/usr/bin/env python
# encoding: utf-8
import sys
import urllib
import codecs
import json
import unicodecsv
import dateutil.parser as parser