Skip to content

Instantly share code, notes, and snippets.

View Sneezry's full-sized avatar
🍑

Zhe Li Sneezry

🍑
View GitHub Profile
@matijagrcic
matijagrcic / Batch-convert-webp-to-png.txt
Created November 18, 2016 18:28
Batch convert webp to png
#Download dwebp (WebP decoder tool) https://developers.google.com/speed/webp/download
#Run
for %f in (*.webp) do dwebp.exe "%f" -o "%~nf.png"
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 29, 2024 12:53
Git HowTo: revert a commit already pushed to a remote repository

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:

@YoungjaeKim
YoungjaeKim / teamcity_azure_worker_role.ps1
Last active December 23, 2015 05:53 — forked from srkirkland/deploy.ps1
PowerShell script to deploy package to Azure Worker Role by using teamcity CI build server
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
#Modified and treat error-terminating of http://weblogs.asp.net/srkirkland/ci-deployment-of-azure-web-roles-using-teamcity
$ErrorActionPreference = "Stop"
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
@jpoehls
jpoehls / node-cluster-messaging.js
Created March 29, 2012 01:48
Simple message passing between cluster master and workers in Node.js
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.