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 sys | |
from PyQt5 import QtWidgets, QtGui, QtCore | |
def fetch_data(): | |
return [ | |
{ | |
'name': 'horizontal', | |
'image': { | |
'colour': (255, 0, 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
import os | |
import sys | |
from distutils import sysconfig | |
def std_modules(): | |
std_lib = sysconfig.get_python_lib(standard_lib=True) | |
for top, dirs, files in os.walk(std_lib): | |
for nm in files: |
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 sys | |
import multiprocessing | |
from PyQt5 import QtWidgets | |
def calc(): | |
# random cpu bound computation | |
result = 0 | |
for i in range(10 ** 7): | |
result += i ** 2 |
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 unittest | |
def ikePoleVector(root, mid, end): | |
result = [] | |
for i in range(len(root)): | |
v1 = end[i] - root[i] | |
midV1 = v1 * 0.5 | |
v2 = end[i] - midV1 | |
v3 = mid[i] - v2 | |
vf = mid[i] + v3 |
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
#!/usr/bin/python | |
import imp | |
import sys | |
def main(filepath): | |
module = imp.load_source('foo', filepath) | |
entities = [repr(x) for x in dir(module) if not x.startswith('__')] | |
if entities: | |
text = ', '.join(entities) |
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 QtQuick 2.5 | |
Item { | |
id: container | |
property alias cellColor: rectangle.color | |
signal clicked(color cellColor) | |
width: 40; height: 25 | |
Rectangle { |
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 re | |
import sys | |
from PySide import QtGui | |
DELIMITERS = r'[,_\s]' | |
class MultiCompleter(QtGui.QCompleter): | |
def pathFromIndex(self, index): |
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
float circle(vec2 uv, vec2 p, float r, float blur) | |
{ | |
return smoothstep( r, r-blur, length(uv - p) ); | |
} | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 uv = ( fragCoord.xy / iResolution.xy ) - .5f; |
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
#!/home/csaez/.nvim/py2/bin/python2 | |
# -*- coding: utf-8 -*- | |
import re | |
import sys | |
from flake8.main.cli import main | |
if __name__ == '__main__': | |
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[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
#!/bin/bash | |
export HOUDINI_OGL_CORE_PROFILE=1 | |
/opt/hfs15.5.620/bin/happrentice |
NewerOlder