This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
make sure the following lines are set in /etc/sshd_config (or /etc/ssh/sshd_config on ubuntu) | |
(they all exist already, but are commented, some may have a value of yes) | |
PasswordAuthentication no | |
ChallengeResponseAuthentication no | |
UsePAM no | |
then restart the ssh server (uncheck / recheck 'Remote Login' in the 'System Preferences' -> 'Sharing' panel) |
# -*- coding: utf-8 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.utils.cache import patch_response_headers | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import cache_page, never_cache | |
from django.views.decorators.csrf import csrf_exempt | |
class NeverCacheMixin(object): | |
@method_decorator(never_cache) |
#!/usr/bin/env python | |
# coding: utf-8 | |
# This little project is hosted at: <https://gist.github.com/1455741> | |
# Copyright 2011-2020 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
import os | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText |
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask_httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'miguel': |
def not_in_student_group(user): | |
"""Use with a ``user_passes_test`` decorator to restrict access to | |
authenticated users who are not in the "Student" group.""" | |
return user.is_authenticated() and not user.groups.filter(name='Student').exists() | |
# Use the above with: | |
@user_passes_test(not_in_student_group, login_url='/elsewhere/') | |
def some_view(request): | |
# ... |
#!/bin/bash | |
# This scripts scans the elasticsearch source code for all the registered REST endpoints | |
# It will put the formatted output in $DEFINITIONOUTPUTFILE | |
# [MethodName] [HttpVerb] [Route] | |
ESFOLDER="../elasticsearch" | |
DEFINITIONOUTPUTFILE="src/Generated/rest-actions.txt" | |
# Find all the lines that registerHandlers |
from __future__ import print_function | |
import cookielib | |
import getpass | |
import HTMLParser | |
import re | |
import sys | |
import urllib | |
import urllib2 |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |