Skip to content

Instantly share code, notes, and snippets.

@gurel
gurel / Stylefile.yml
Last active August 3, 2018 03:14 — forked from skttl/Stylefile.yml
Customizations for www.youtube.com via StyleURL.
---
version: 1.0
domains:
- www.youtube.com
url_patterns:
- www.youtube.com/*
timestamp: '2018-08-02T20:46:51Z'
id: pqTX
redirect_url: https://www.youtube.com/watch?v=s0vg_H9hBuU
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome
import React from "react"
// ReadMe:
// React Lifecycle => https://facebook.github.io/react/docs/component-specs.html
// ES6 Transform => http://babeljs.io/blog/2015/06/07/react-on-es6-plus/
export default class ${NAME} extends React.Component {
displayName: "${NAME}"
static propTypes = {
// ...
var Latinise={};Latinise.latin_map={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"I","Ǐ":"I","Î":"I","Ï":"I","Ḯ":"I","İ":"I","Ị":"I","Ȉ":"I",
@gurel
gurel / gist:d7634c9640a08b96c0ea
Created April 27, 2015 15:05
Sql Alchemy Profiling
from sqlalchemy import event
from sqlalchemy.engine import Engine
import time
import logging
logging.basicConfig()
logger = logging.getLogger("myapp.sqltime")
logger.setLevel(logging.DEBUG)
@event.listens_for(Engine, "before_cursor_execute")
@gurel
gurel / gist:7e64828cb8e364b79ad5
Created April 3, 2015 05:41
Tornado - Routing - Pass fields as params
import tornado.web
import tornado.httpserver
class TestParamsHandler(tornado.web.RequestHandler):
def get(self, param1, param2, param3):
param2 = param2 if param2 else 'default2'
param3 = param3 if param3 else 'default3'
self.write(
{
'param1': param1,
$(document).delegate('#textbox', 'keydown', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
e.preventDefault();
var start = $(this).get(0).selectionStart;
var end = $(this).get(0).selectionEnd;
// set textarea value to: text before caret + tab + text after caret
$(this).val($(this).val().substring(0, start)
@gurel
gurel / gist:ad14f4cd4b4bb43c06b8
Created August 19, 2014 09:47
Python Switch Case
class switch(object):
value = None
def __new__(class_, value):
class_.value = value
return True
def case(*args):
return any((arg == switch.value for arg in args))