Skip to content

Instantly share code, notes, and snippets.

@kostnikolas
kostnikolas / 1-setup.md
Created July 28, 2021 08:01 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

[
{
"content_id": "1",
"content_type": "article",
"title": "Выбор коляски для малыша",
"teaser": "Как выбрать детскую коляску? – спрашивают неопытные родители. Ответ прост – учитывайте предпочтения мамы...",
"master_image": "/media/original_image.jpg",
"url":"/articles/4235-vibor-kolyaski-dlya-malisha/",
"author": {
"name": "Ализаровна",
@kostnikolas
kostnikolas / gist:eeed5821041bc33ef121
Created November 23, 2015 06:27
Skype no advertising. Hosts file
127.0.0.1 apps.skype.com
127.0.0.1 live.rads.msn.com
127.0.0.1 ads1.msn.com
127.0.0.1 static.2mdn.net
127.0.0.1 g.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 b.ads2.msads.net
127.0.0.1 ad.doubleclick.net
127.0.0.1 ac3.msn.com
127.0.0.1 rad.msn.com
$.ajaxSetup({
beforeSend: function(xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
getCookie = (name) ->
for cookie in document.cookie.split ';' when cookie and name is (cookie.split '=')[0]
return decodeURIComponent cookie[(1 + name.length)...]
null
$.ajaxSetup
beforeSend: (xhr, settings) ->
unless (/^http:.*/.test settings.url) or (/^https:.*/.test settings.url)
xhr.setRequestHeader "X-CSRFToken", getCookie 'csrftoken'