Skip to content

Instantly share code, notes, and snippets.

View Keda87's full-sized avatar
:shipit:
Hmmmm

Adiyat Mubarak Keda87

:shipit:
Hmmmm
View GitHub Profile
@Keda87
Keda87 / .tmux.conf
Last active May 24, 2019 09:04
prefix = ctrl + a
# Remap prefix from `C-b` to `C-a`
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Easy reload config file.
# bind r source-file ~/.tmux.conf
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind-key M split-window -h "vim ~/.tmux.conf"
@Keda87
Keda87 / fields.py
Last active May 3, 2024 17:19
DRF field to handle base64 encoded string as attachment. Automatically transform it to binary file.
import cStringIO
import six
import uuid
from base64 import decodestring
from mimetypes import guess_type, guess_extension
from django.core.files.uploadedfile import SimpleUploadedFile
class Base64CharField(serializers.CharField):
"""
@Keda87
Keda87 / country_code.txt
Created May 1, 2017 09:43
Generate Country Choices in Django
AF
AL
DZ
AS
AD
AO
AI
AQ
AG
AR
@Keda87
Keda87 / mixins.py
Last active March 21, 2018 05:54
Django model mixin class to extends django-storages (https://github.com/jschneier/django-storages) ability to backup media files to local storage.
import os
from django.conf import settings
from django.core.files import File
from django.core.files.storage import FileSystemStorage
class LocalMediaSaveMixin(object):
"""Mixin class to for backing up media files on model that has
image/file fields. To use it, ensure to keep in my python multiple
@Keda87
Keda87 / s3_test.py
Created October 24, 2016 10:16 — forked from tomviner/s3_test.py
Simple example of an S3 django storage backend saving a file from local and url
import os
import urllib2
import contextlib
import StringIO
from django.core.files.storage import get_storage_class, FileSystemStorage
from django.core.files import File
from django.conf import settings
from galleries.models import GalleryImage
@Keda87
Keda87 / en-id-stopwords.txt
Created October 4, 2016 23:54
English and Indonesian stop words database from http://sutanto.org/crawling-twitter-search/
0
1
2
3
4
5
6
7
8
9
@Keda87
Keda87 / permissions.txt
Created October 3, 2016 09:38 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.REAL_GET_TASKS
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.REMOTE_AUDIO_PLAYBACK
android.permission.REGISTER_WINDOW_MANAGER_LISTENERS
android.permission.INTENT_FILTER_VERIFICATION_AGENT
android.permission.BIND_INCALL_SERVICE
android.permission.WRITE_SETTINGS
android.permission.CONTROL_KEYGUARD
android.permission.CONFIGURE_WIFI_DISPLAY
android.permission.ACCESS_WIMAX_STATE
@Keda87
Keda87 / clojure.md
Created August 2, 2016 09:20
Setting Up Clojure on OS X

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

I appreciate the effort you've put into documenting this, but there are a number of inaccuracies here that need to be addressed. We get

@Keda87
Keda87 / iterm2-solarized.md
Created August 2, 2016 00:32 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OS X / macOS)

Solarized

@Keda87
Keda87 / rent_statistics.py
Created July 27, 2016 09:30
Django Template Filter for Humanize Day
"""
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Adiyat Mubarak <adiyatmubarak@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.