Skip to content

Instantly share code, notes, and snippets.

View isratmir's full-sized avatar
🍔
Focusing

Kozhomuratov Ulan isratmir

🍔
Focusing
  • Kyrgyzstan, Bishkek
View GitHub Profile
@isratmir
isratmir / forismatic.py
Created April 11, 2016 09:21
Read forismatic.com quotes from ubuntu cmd
#!/usr/bin/python
import sys
import os
import requests
import json
url = 'http://api.forismatic.com/api/1.0/'
params = dict(
@hellysmile
hellysmile / repositories.py
Last active February 3, 2023 22:27
django repository pattern
from django.contrib.sites.models import Site
class Object(object):
def __init__(self, model, key):
self.model = model
self.key = key
def __call__(self, *args, **kwargs):
params = {}
@kurisuchan
kurisuchan / gist:1262135
Created October 4, 2011 16:43
Moving MySQL databases to ramdisk on Ubuntu
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux
# Log in as root
# Mount ramdisk folder in RAM
mkdir /tmp/ramdisk
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/
# Move MySQL data
mv /var/lib/mysql /tmp/ramdisk/mysql
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql