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
# you'll need to install react-native-expo-svg using npm or any other pm | |
# before running this code | |
for img in *.svg; do react-native-expo-svg $img; done |
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 iterationCopy(src) { | |
let target = {}; | |
for (let prop in src) { | |
if (src.hasOwnProperty(prop)) { | |
target[prop] = src[prop]; | |
} | |
} | |
return target; | |
} | |
const source = {a:1, b:2, c:3}; |
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 findChars(word, ...letters){ | |
let maxIndex; | |
if (word.match(/^$/)) { | |
return -1; | |
} | |
for(let i = 0; i<letters.length; i++){ | |
if(word.indexOf(letters[i]) != -1){ | |
maxIndex = word.indexOf(letters[i]); | |
break; | |
} |
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 reducer = (accumulator, currentValue) => accumulator + currentValue; | |
function somOfPrimes(range) { | |
let store = []; | |
let primes = []; | |
for (let i = 2; i <= max; ++i) { | |
if (!store [i]) { | |
primes.push(i); | |
for (let j = i << 1; j <= max; j += i) { |
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
// Formats response to look presentable on webpage | |
const renderResponse = (res) => { | |
// Handles if res is falsey | |
if(!res){ | |
console.log(res.status); | |
} | |
// In case res comes back as a blank array | |
if(!res.length){ | |
responseField.innerHTML = "<p>Try again!</p><p>There were no suggestions found!</p>"; | |
return; |
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
@keyframes circle-beating { | |
0% { | |
-webkit-box-shadow: 0 0 0 2px rgba(255, 255, 255, 0); | |
-moz-box-shadow: 0 0 0 2px rgba(255, 255, 255, 0); | |
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0); | |
} | |
50% { | |
transition: all .5s linear; | |
-moz-box-shadow: 0 0 0 10px rgba(255, 255, 255, .5); |
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
/* This is a small sampling of the various approaches to media queries. The | |
point is: they're all over the board. Part of the "issue" (if you can call | |
it that) may be due to the intended audience of each site/framework. Another | |
may be that it's really difficult to test for a lot of different devices. | |
Regardless, it would be really nice if there was standard baseline that | |
could be used as a starting point for maximum compatibility and coverage. */ | |
/* ========================================================================== | |
Frameworks | |
========================================================================== */ |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
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
for (var i = 0; i < contacts.length; i++) { | |
for (var j = 0; j < contacts[i].length; j++) { | |
console.log(contacts[i][j]); | |
} | |
if (contacts.hasOwnProperty(firstName) || contacts.hasOwnProperty(prop)) { | |
return contacts.prop; | |
} else if (contacts.hasOwnProperty(firstName) !== true) { | |
return "No shuch contact" | |
} else if (contacts.hasOwnProperty(prop) !== true) { | |
return "No such property"; |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
int main() { | |
int i; | |
int n = 100000; |
NewerOlder