Skip to content

Instantly share code, notes, and snippets.

@andrew-nuwber
andrew-nuwber / README.md
Last active December 29, 2023 00:26
Namecheap DNS to zone file
@DoonDoony
DoonDoony / pycharm_python_console_shell_plus_script.py
Last active January 20, 2024 15:50
Using `shell_plus` in pycharm django console
# 💡 NOTE: This only works if you are pretend to using `Django Console` feature in Pycharm
# Paste codes below into `Build, Execution, Deployment > Console > Django Console > Starting Script`
# requirements: `django_extensions`, `IPython`
import sys
import django
from IPython.core.getipython import get_ipython
from django_extensions.management.notebook_extension import load_ipython_extension
import requests
import json
class Flower:
DEFAULT_API_URL = 'https://api.crowdflower.com/v1/'
DEFAULT_API_HEADERS = {'content-type': 'application/json'}
def __init__(self, api_key, api_url = DEFAULT_API_URL, api_headers = DEFAULT_API_HEADERS):
self.api_key = api_key
self.api_url = api_url
@vshjxyz
vshjxyz / Appfog django south migrate.py
Last active December 13, 2015 23:58
This is the content of my __init__.py to perform migrations on appfog I needed this because the django-allauth package need to do some migrations initially to work. The Appfog's lack of post-deploy scripts forced me to create a script that I had to put inside one of the apps in my project django_project/appname/management/__init__.py should make…
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.db.models.signals import post_syncdb
from south.models import MigrationHistory
import pizzanuvola_teaser.settings as settings
def migration_exists(appname, migrationnumber):
appname = appname.split('.')[-1]
return MigrationHistory.objects.filter(app_name=appname, migration__icontains=migrationnumber).exists()
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: