Skip to content

Instantly share code, notes, and snippets.

[14:08:39] space (asgardia_blog) git:(2017-may) $ ./manage.py migrate
DATABASES
{
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"NAME": "asgardia_blog",
"USER": "postgres"
}
}
@ivan-hilckov
ivan-hilckov / git aliases.sh
Created March 19, 2017 09:07 — forked from tj/git aliases.sh
Some helpful git aliases
alias gd="git diff"
alias gc="git clone"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gpt="git push --tags"
alias gp="git push"
alias gpr="git pull-request"
alias grh="git reset --hard"
@ivan-hilckov
ivan-hilckov / fix-the-psql-load.sh
Created November 16, 2016 10:12
the new psql-load.sh
#!/bin/bash
DB_NAME=
FILE_PATH=
DB_OWNER="postgres"
while getopts ":d:u:f:" flag
do
case "$flag" in
'd') DB_NAME=$OPTARG ;;
export function* removeUser(id,token, eteg) {
const url = `/users/${id}`;
const res = yield call(deleteApi, url, {}, {}, token, eteg);
if (!res.err && !res.data.error) {
yield put(onRemoveUsersSuccess());
} else {
yield put(onRemoveUsersSuccess());
}
}
export function string2bool(str) {
switch (str) {
case 'true':
return true;
case 'false':
return false;
default:
return str;
}
}
import axios from 'axios';
import { baseUrl } from 'config';
export default function request(path, method, params, data, token, eteg) {
const headers = {};
if (token) {
headers['Authorization'] = token; // eslint-disable-line dot-notation
}
@ivan-hilckov
ivan-hilckov / Readme.md
Created October 16, 2016 08:24 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
curl 'http://localhost:8000/api/v1/entry/comment/'
-H 'Pragma: no-cache'
-H 'Origin: http://localhost:8000'
-H 'Accept-Encoding: gzip, deflate'
-H 'Accept-Language: en-US,en;q=0.8,ru;q=0.6'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36'
-H 'Content-Type: application/json'
-H 'Accept: application/json, text/javascript, */*; q=0.01'
-H 'Cache-Control: no-cache'
-H 'X-Requested-With: XMLHttpRequest'
import React from 'react';
import { PropTypes, assertPropTypesDecorator } from 'iv-react-prop-types';
const VIEWBOX_REGEXP = /viewBox="([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)"/i;
function getViewBoxFromSvgHtml (html) {
const viewBoxMatch = VIEWBOX_REGEXP.exec(html);
if (viewBoxMatch) {
return [ parseFloat(viewBoxMatch[3]) || 0, parseFloat(viewBoxMatch[4]) || 0 ];
➜ nginx sudo iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere