Skip to content

Instantly share code, notes, and snippets.

View johnakhilomen's full-sized avatar
💭
Cooking node-badger and looking forward to the stable-release soon

John Akhilomen johnakhilomen

💭
Cooking node-badger and looking forward to the stable-release soon
View GitHub Profile
import { toBeInTheDocument } from "@testing-library/jest-dom/matchers";
import Event from "../components/Event";
import { getEvents } from "../api";
import { render, fireEvent, waitFor } from "@testing-library/react";
import mockData from "../mock-data";
describe('<Event /> component', () => {
let EventComponent;
const allEvents = getEvents();
console.log(mockData[0]);
{
"name": "Smsh",
"symbol": "SMSH",
"description": "Testing Smsh",
"image": " "
}
@johnakhilomen
johnakhilomen / Jenkinsfile
Created July 7, 2023 06:18 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
const comments = [
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
const getMaleStudents = function(students){
studentList = []
for (let i = 0; i < students.length; i++) {
if (students[i].gender == "Male") {
studentList.push(students[i])
}
}
return studentList;
}
let calculateSum = function (numbers) {
let sum = 0;
for (let i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
return sum;
}
const sum = calculateSum([45,89,32,90,120]);
console.log(sum);
function Calculator(data) {
var obj = {};
obj.getSum = function () {
return calculateSum(data);
};
obj.getAverage = function () {
return calculateSum(data)/data.length;
};
return obj;
}
@johnakhilomen
johnakhilomen / gist:d5a86078b56a269f50abde38b1a54dde
Created September 12, 2021 05:19
Xcode command line not found by expo or other build processes
Open Xcode
go to preferences
go to locations tab
select an Xcode version in the select labeled “Command Line Tools”
### First Method
Deleting the `.git` folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:
```
# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH
# Add all the files:
git add -A
@johnakhilomen
johnakhilomen / CSS3 Media Queries Template
Created March 15, 2021 05:50
CSS3 Media Queries template
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}