Skip to content

Instantly share code, notes, and snippets.

Avatar

Julián Herrera vidjuheffex

View GitHub Profile
@vidjuheffex
vidjuheffex / qwebchannelexample.py
Last active Mar 14, 2022
QWebChannel Example Script
View qwebchannelexample.py
"""create a remote connection to a webapp."""
import sys
import json
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtNetwork import QHostAddress, QSslSocket
from PySide6.QtWebChannel import QWebChannel, QWebChannelAbstractTransport
from PySide6.QtWebSockets import QWebSocketServer
from PySide6.QtWebEngineWidgets import QWebEngineView
@vidjuheffex
vidjuheffex / main.scm
Last active Aug 16, 2020
mpg123 - port audio chez example
View main.scm
#!/usr/bin/env scheme-script
;; -*- mode: scheme; coding: utf-8 -*- !#
;; Copyright (c) 2020 Julian Herrera
;; SPDX-License-Identifier: MIT
#!r6rs
(import (chezscheme)(prefix (mpg123) mpg123:)(lento))
(define lib-portaudio (load-shared-object "libportaudio.so"))
View classes.js
// CLASSES PROJECT
// In this project, you will build a Mazda car factory that manufactures both cars and trucks.
// Read each set of instructions carefully!
// BUILD YOUR FACTORY!
// DECLARE A FACTORY CLASS
// All automobiles manufacutered should have the following properties: make (Mazda), location (USA), airbags (true), abs (true), warranty (60,000 miles / 3 years)
// This factory should also run two functions: massBuild() and customerBuild()
@vidjuheffex
vidjuheffex / main.js
Created Jul 17, 2017
Modifications to main.js to have tests pass
View main.js
//###################################################################
// __
// ____/ /___ ____ ______
// / __ / __ \/ __ `/ ___/
// / /_/ / /_/ / /_/ (__ )
// \__,_/\____/\__, /____/
// /____/
// Dog Constructor & Prototype
var Dog = {
@vidjuheffex
vidjuheffex / README.md
Created Jun 12, 2017
Object and scope Assesment
View README.md

Scope, hoisting and compartmentalization

Answer the following:

In you own words, explain the concepts of scope, hoisting, compartmentalization.

Scope: The section of code within which a variables value holds.

Hoisting: How the javascript interpreter rearranges your code before evaluation. By bringing variable declration and function definitions to the top.

Compartmentalization: Taking advantage of scope to minimize pollution of the global environment.

@vidjuheffex
vidjuheffex / main.js
Created Jun 7, 2017
arrays and loops
View main.js
// 1.
// Without logging the values, list the value of `sports` and `total`
var sports = ['soccer', 'baseball'];
var total = sports.push('football', 'swimming');
// A:
// sports = ['soccer', 'baseball'];
// total = ['soccer', 'baseball', 'football', 'swimming']
// 2.
@vidjuheffex
vidjuheffex / main.js
Created Jun 6, 2017
Function Expression Individual Assesment
View main.js
// 1.
// Define a function max() that takes two numbers as arguments and returns the largest of them. Use the if-then-else construct available in JavaScript.
// A:
function max(num1, num2){
return (num1 > num2) ? num1 : num2;
}
// 2.
View main.js
// Answer the following questions in this file using comments without running the code
// 1.
// What does `givenName` equal right now?
var givenName;
// A: undefined
// 2.
// What is `givenName` set to right now?
@vidjuheffex
vidjuheffex / selectionSetPicker.py
Created Mar 30, 2017
finds all quick selection sets in the scene. Adds them to a panel to make selecting them easier
View selectionSetPicker.py
import maya.cmds as cmds
from functools import partial
class selectionSetGUI(object):
def __init__(self):
return None
def select(self, set, *args):
print set