Skip to content

Instantly share code, notes, and snippets.

Juan jcramirez

Block or report user

Report or block jcramirez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jcramirez
jcramirez / hexTools.py
Created Jul 31, 2013
A class I wrote as an utility when dealing with byte data. It can create bytes out of nibbles, words out of bytes and break words into a byte lists. All inputs are validated and the exceptions are raised.
View hexTools.py
class HexTools():
"""
Performs simple operations on byte or word data
"""
MAX_VALUE_FOR_BYTE = 0xFF
MAX_VALUE_FOR_WORD = 0xFFFF
MAX_VALUE_FOR_NIBBLE = 0x0F
@staticmethod
def getHighNibbleFromByte(byte=0):
@jcramirez
jcramirez / 0_reuse_code.js
Created Jul 26, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jcramirez
jcramirez / preventMustachesVue.txt
Last active Sep 13, 2017
Prevent showing mustaches before Vue.js is ready
View preventMustachesVue.txt
// css
[v-cloak] {
display: none;
}
// html
<div v-cloak>
{{ message }}
</div>
@jcramirez
jcramirez / promiseRecursion.js
Created Oct 3, 2017
sample of how to do recursion using a promises
View promiseRecursion.js
/**
* @param {Integer} devs
* @param {Array} elem
*/
let getSequences = (devs, elem) => {
return new Promise((resolve, reject) => {
if (devs === 0) {
resolve(elem)
return
}
You can’t perform that action at this time.