Skip to content

Instantly share code, notes, and snippets.

View paulruescher's full-sized avatar

Paul Ruescher paulruescher

  • Rivian
  • Vancouver, BC
View GitHub Profile
@paulruescher
paulruescher / spawner.ex
Created January 29, 2019 22:00
Spins up "concurrent" tasks
defmodule Spawner do
def process() do
receive do
after
1_000 ->
IO.puts "1 seconds elapsed"
for i <- 0..40, i > 0 do
Task.start(ModuleName, :func_name, [[key: value]])
end
int main()
{
    // Variable declaration
    int choice;
    // Print the main menu
    cout << "CMPT 126 - Assignment 1\n";
    cout << "\nPlease select one of the followings:\n";
    cout << "1\tQuadratic equation solver.\n";
    cout << "2\tReverse an integer and sum its digits.\n";
const NotificationHoC = function(Component) {
return React.createClass({
componentDidMount() {
const success = (notifications) => {
this.setState({
notifications: notifications,
});
};
$.ajax({
const Container = React.createClass({
componentDidMount() {
const success = (notifications) => {
this.setState({
notifications: notifications,
});
};
$.ajax({
url: '/notifications',
const Container = React.createClass({
componentDidMount() {
const success = (notifications) => {
this.setState({
notifications: notifications,
});
};
$.ajax({
url: '/notifications',
const Container = React.createClass({
componentDidMount() {
const success = (notifications) => {
this.setState({
notifications: notifications,
});
};
$.ajax({
url: '/notifications',
function fullName(firstName, lastName) {
return `${firstName} ${lastName}`;
}
function createEl(el) {
return document.createElement(el);
}
function wrapContentWithEl(el, content) {
return el.innerHTML = content;
function f(x) {
return x * 10;
}
function g(x) {
return x + 2;
}
f(g(2)); // 40
const notifications = [
{
date: "Nov 10, 2015 8:00:00",
message: "Tagged in a photo",
},
{
date: "Nov 10, 2015 9:00:00",
message: "Mentioned in a post",
},
];
const notifications = [
{
date: "Nov 10, 2015 8:00:00",
message: "Tagged in a photo",
},
{
date: "Nov 10, 2015 9:00:00",
message: "Mentioned in a post",
},
];