This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Text; | |
using UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.UI; | |
public class TextRevealer : MonoBehaviour | |
{ | |
[UnityEngine.Header("Configuration")] | |
public int numCharactersFade = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection | |
print(connection.queries) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Sample JSON Object | |
# "pending_renewal_info": [ | |
# { | |
# "expiration_intent": "1", | |
# "auto_renew_product_id": "renew_product_id", | |
# "original_transaction_id": "1000000218147500", | |
# "is_in_billing_retry_period": "0", | |
# "product_id": "product_id", | |
# "auto_renew_status": "0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# insures auth headers are passed to flask | |
files: | |
"/etc/httpd/conf.d/wsgi_custom.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
WSGIPassAuthorization On |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# considering model has audio_field = FileField() | |
def some_pre_save_receiver(sender, instance, raw, using, update_fields, **kwargs): | |
file_was_updated = False | |
if hasattr(instance.audio_file, 'file') and isinstance(instance.audio_file.file, UploadedFile): | |
file_was_updated = True | |
if update_fields and "audio_file" in update_fields: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load rest_framework %} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Swagger</title> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" type="text/css" href="//unpkg.com/swagger-ui-dist@3/swagger-ui.css" /> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template import loader, Template, Context | |
from rest_framework.filters import SearchFilter | |
browsable_api_filter_template = """{% load i18n %} | |
<h2>{{ title }}</h2> | |
<p>{{description}}</p> | |
<form class="form-inline"> | |
<div class="form-group"> | |
<div class="input-group"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace datagreed.input | |
{ | |
/// <summary> | |
/// Implements proper deadzones for joystick or gamepad sticks. | |
/// Based on http://www.third-helix.com/2013/04/12/doing-thumbstick-dead-zones-right.html | |
/// | |
/// Example usage: | |
/// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example of threads working on a queue | |
from Queue import Queue | |
from threading import Thread | |
num_worker_threads = 10 | |
# items to work on | |
def source(): | |
return xrange(400) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -n -i4TCP:8080 | grep LISTEN |