Skip to content

Instantly share code, notes, and snippets.

View neomatrixcode's full-sized avatar
🏠
Working from home

Josué Acevedo (Neomatrix) neomatrixcode

🏠
Working from home
View GitHub Profile
#!/bin/bash
## SPDX-License-Identifier: GPL-2.0
# Copyright(c) Shuah Khan <skhan@linuxfoundation.org>
#
# License: GPLv2
# Example usage: stable_rc_checkout.sh <stable-rc e.g 5.2>
mkdir -p stable_rc
cd stable_rc
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-$1.y
cd linux-$1.y
sudo apt-get update
sudo apt-get install build-essential vim git cscope libncurses-dev libssl-dev bison flex git-email -y
cd /
sudo mkdir /linux_work
cd /linux_work
sudo git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux_mainline
/** Helping function used to get all methods of an object */
const getMethods = (obj) => Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(item => typeof obj[item] === 'function')
/** Replace the original method with a custom function that will call our aspect when the advice dictates */
function replaceMethod(target, methodName, aspect, advice) {
const originalCode = target[methodName]
target[methodName] = (...args) => {
if(["before", "around"].includes(advice)) {
aspect.apply(target, args)
}
const AOP = require("./aop.js")
class MyBussinessLogic {
add(a, b) {
console.log("Calling add")
return a + b
}
concat(a, b) {
/** Helping function used to get all methods of an object */
const getMethods = (obj) => Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(item => typeof obj[item] === 'function')
/** Replace the original method with a custom function that will call our aspect when the advice dictates */
function replaceMethod(target, methodName, aspect, advice) {
const originalCode = target[methodName]
target[methodName] = (...args) => {
if(["before", "around"].includes(advice)) {
aspect.apply(target, args)
using Merly
using JSON
function tojson(data::String)
return JSON.parse(data)
end
formats["application/json"] = tojson
mutable struct Animal
@neomatrixcode
neomatrixcode / fizzbuzz_4.jl
Created January 25, 2021 20:55 — forked from niczky12/fizzbuzz_4.jl
Fizzbuzz 4
function fizzbuzz(n)
numbers = 1:n
# first we convert the numbers to strings
result = string.(numbers)
result[rem.(numbers, 3) .== 0] .= "Fizz"
result[rem.(numbers, 5) .== 0] .= "Buzz"
result[(rem.(numbers, 3) .== 0) .* (rem.(numbers, 5) .== 0)] .= "FizzBuzz"
import logo from './logo.svg';
import './App.css';
import AgregarTareaContainer from './containers/agregarTareaContainer'
import VerTareasContainer from './containers/verTareasContainer'
function App() {
return (
<div className="App">
<header className="App-header">
import React from 'react'
const verTareaPresentational = ({ tareas }) => (
<ul>
{tareas.map(tarea =>
<li key={tarea.id}>
{tarea.text}
</li>
)}
</ul>
import { connect } from 'react-redux'
import verTareaPresentational from '../presentationals/verTareaPresentational'
const mapStateToProps = state => ({
tareas: state.tareas
})
export default connect(
mapStateToProps