Skip to content

Instantly share code, notes, and snippets.

View iKlotho's full-sized avatar
🏠
Working from home

Umut Kahriman iKlotho

🏠
Working from home
  • İstanbul, Turkey
View GitHub Profile
@iKlotho
iKlotho / validate_taginputs.js
Created April 28, 2019 15:22
Validating TR numbers with bootstrap taginputs
/*
*https://github.com/jackocnr/intl-tel-input
*https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/
*/
$('#send_sms_numbers').on('beforeItemAdd', function(event) {
// event.item: contains the item
// event.cancel: set to true to prevent the item getting added
// TR numbers startswith 90
// we also delete 0 at the beginning for our convenience
@iKlotho
iKlotho / .vimrc
Last active September 11, 2019 06:48
my vimrc
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
"disable hjkl
noremap <Right> <NOP>
"disable hjkl
"
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
@iKlotho
iKlotho / freebsd_ramdisk
Created April 19, 2019 09:13
Moving FreeSWITCH Core.db to Ramdisk in FreeBSD
vim /etc/fstab
# Device Mountpoint FStype Options Dump Pass#
/dev/da0a / ufs rw 1 1
tmpfs /usr/local/freeswitch/ramdisk tmpfs rw 0 0 *** add this line to your file
/dev/da0b none swap sw 0 0
create ramdisk folder in freeswitch directory (mkdir ramdisk)
sudo mount -a
@iKlotho
iKlotho / apache
Created March 5, 2019 11:08
apache conf redirect http to https
< vh >
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
< /vh >
match and redirect
# NC means no case makes the case-intensitive
RewriteCond %{REQUEST_URI} ^/events [NC]
@iKlotho
iKlotho / bashes
Created February 13, 2019 08:48
bash commands
find -L . -name Makefile | xargs sed -i 's/find/replace/g' -> find file named Makefile and change text inside it
@iKlotho
iKlotho / ip
Created January 26, 2019 09:15
debian ip
dir -> /etc/network/interfaces
eno -> ethernet connection
change iface inet eno1 dynamic to static
append
address xx.x.x.x
netmask x.x.x.x
gateway xx.x.x.x
service network restart
@iKlotho
iKlotho / i18n
Created January 25, 2019 07:00
i18n django
#django muti language
#add settings.py middleware
'django.middleware.locale.LocaleMiddleware',
#add settings.py
from django.utils.translation import ugettext_lazy as _
LOCALE_PATHS = (os.path.join(BASE_DIR, "locale"),)
LANGUAGES = (
('tr', _('Turkish')),
('en', _('English')),
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@iKlotho
iKlotho / dt-django-picker.py
Created January 15, 2019 12:15
datatable-django-datetimepicker
** Date time field -> https://github.com/monim67/django-bootstrap-datepicker-plus
** Datatables and Django -> https://pypi.org/project/django-datatables-view/
** Forms.py Buttons and Feilds -> https://django-crispy-forms.readthedocs.io/en/latest/install.html
Context
*** -> dt_json - url for datatable
@iKlotho
iKlotho / demo.js
Created October 5, 2018 21:58
demo
(function() {
var utils;
var playerSelector = '.sm2-bar-ui';
var players = window.sm2BarPlayers;
var Player = window.SM2BarPlayer;