This file contains 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 | |
## SPDX-License-Identifier: GPL-2.0 | |
# Copyright(c) Shuah Khan <[email protected]> | |
# | |
# 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 |
This file contains 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
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 |
This file contains 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
/** 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) | |
} |
This file contains 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
const AOP = require("./aop.js") | |
class MyBussinessLogic { | |
add(a, b) { | |
console.log("Calling add") | |
return a + b | |
} | |
concat(a, b) { |
This file contains 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
/** 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) |
This file contains 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
using Merly | |
using JSON | |
function tojson(data::String) | |
return JSON.parse(data) | |
end | |
formats["application/json"] = tojson | |
mutable struct Animal |
This file contains 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
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" | |
This file contains 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 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"> |
This file contains 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 React from 'react' | |
const verTareaPresentational = ({ tareas }) => ( | |
<ul> | |
{tareas.map(tarea => | |
<li key={tarea.id}> | |
{tarea.text} | |
</li> | |
)} | |
</ul> |
This file contains 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 { connect } from 'react-redux' | |
import verTareaPresentational from '../presentationals/verTareaPresentational' | |
const mapStateToProps = state => ({ | |
tareas: state.tareas | |
}) | |
export default connect( | |
mapStateToProps |
NewerOlder