Skip to content

Instantly share code, notes, and snippets.

View ivan-hilckov's full-sized avatar
🤔

Ivan Hilkov ivan-hilckov

🤔
View GitHub Profile
{
test: /(?<!\.module)\.scss$/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
},
},

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

ViewSetException at /en/blog/
No view
Request Method: GET
Request URL: http://localhost:8000/en/blog/
Django Version: 1.11.6
Exception Type: ViewSetException
Exception Value:
No view
Exception Location: /Users/bzzz/projects/asgardia-default/space/project/contrib/views/view_set.py in get_redirect_url, line 124
Python Executable: /Users/bzzz/projects/asgardia-default/bin/python
{
"type":"FeatureCollection",
"features":[
{
"geometry":{
"type":"Point",
"coordinates":[
36.28844261169434,
55.397587753141366
]
[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
}