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
set path+=** | |
set nocompatible " be iMproved, required | |
filetype off " required | |
let g:python_host_prog = '/usr/bin/python' | |
let g:python3_host_prog = '/usr/local/bin/python3.8' | |
" ----------------------------------------------------------------------------- | |
" | |
" Plugins list |
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
import React, { useState } from "react"; | |
import ReactDOM from "react-dom"; | |
import useFuzzySearch from "./useFuzzySearch"; | |
const persons = [ | |
{ id: 1, name: "genesis" }, | |
{ id: 2, name: "jose" }, | |
{ id: 3, name: "mauro" }, | |
{ id: 4, name: "fredo" }, | |
{ id: 5, name: "meggie" }, |
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
import React, { useRef, useEffect } from 'react'; | |
/** | |
* Example: | |
* const [open, setOpen] = useState(false); | |
* ... | |
* <ClickOutside onBlur={() => setOpen(false)}> | |
* <MyDropdown open={open}/> | |
* </ClickOutsie> | |
*/ |
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
import hoistStatics from 'hoist-non-react-statics'; | |
import React from 'react'; | |
/** | |
* Allows two animation frames to complete to allow other components to update | |
* and re-render before mounting and rendering an expensive `WrappedComponent`. | |
*/ | |
export default function deferComponentRender(WrappedComponent) { | |
class DeferredRenderWrapper extends React.Component { | |
constructor(props, context) { |
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
/* | |
* Download as plain file | |
* @param {String} filename | |
* @param {String} text data | |
*/ | |
function download(filename, text) { | |
var element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
element.setAttribute('download', filename); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>AutoLike Test</title> | |
<style type="text/css" media="screen"> | |
#iframe-wrapper { | |
overflow: hidden; | |
width: 10px; |
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
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import, unicode_literals | |
from rest_framework import serializers | |
from .models import User | |
class UserSerializer(serializers.ModelSerializer): | |
""" | |
User accounts serializer |
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
import random | |
import time | |
def quicksort(items): | |
lowest = [] | |
equal = [] | |
greater = [] | |
if len(items) > 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
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": ["transform-async-to-generator"] | |
} |
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
#python3.5/versatileimagefield/datastructures/base.py | |
# -*- coding: utf-8 -*- | |
def retrieve_image(self, path_to_image): | |
"""Return a PIL Image instance stored at `path_to_image`.""" | |
from urllib.parse import unquote | |
image = self.storage.open(unquote(path_to_image), 'rb') | |
file_ext = path_to_image.rsplit('.')[-1] | |
image_format, mime_type = get_image_metadata_from_file_ext(file_ext) |