Skip to content

Instantly share code, notes, and snippets.

View evgeniikozhanov's full-sized avatar

Evgenii Kozhanov evgeniikozhanov

View GitHub Profile
@drobakowski
drobakowski / RestLeadConvert.cls
Created September 7, 2016 14:18
Apex class for converting a Lead into an Account/Contact/Opportunity through the REST-API
@RestResource(urlMapping='/Lead/*')
global with sharing class RestLeadConvert {
@HttpPost
global static void convertLead() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
res.addHeader('Content-Type', 'application/json');
String leadId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
@frekele
frekele / Jenkinsfile
Created August 4, 2016 06:18
Jenkinsfile pipelineTriggers - TimerTrigger periodic run the aws-update-my-dynamic-ip.sh script.
#!groovy
MAIL_FROM = 'noreply-jenkins@myhost.io'
MAIL_TO = 'jenkins@myhost.io'
GITHUB_PROTOCOL = 'https'
GITHUB_USER_NAME = 'my-github-user'
GITHUB_USER_EMAIL = 'jenkins@myhost.io'
GITHUB_REPO = 'github.com/my-user/my-repository'
GITHUB_PROJECT_URL = "${GITHUB_PROTOCOL}://${GITHUB_REPO}"
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active July 5, 2024 06:54
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:

@subfuzion
subfuzion / curl.md
Last active July 16, 2024 16:18
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Aameer
Aameer / overlay_text_over_image.py
Last active March 1, 2018 17:51
watermark text over images using Python with PIL and textwrap, by tweaking the widths you can control the max length of text allowed and it also does the word wrap and shows extra text in next line
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import textwrap
base_image_location = "/home/aameer/Desktop/test.png" #base image location
W,H=(900, 100) #width and height of base image
font_location = "/home/aameer/Desktop/verdanab.ttf" #font used
output_image_location='/home/aameer/Desktop/' #location where output file will be stored