A Pen by Kaung Myat Lwin on CodePen.
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* STYLES GO HERE */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen |
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
[ | |
{ | |
"css": "html, body {\n width: 100%;\n height: 100%;\n}", | |
"cssMode": "css", | |
"externalLibs": { | |
"css": "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/css/materialize.min.css", | |
"js": "https://unpkg.com/[email protected]/dist/vue.min.js\nhttps://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js\nhttps://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/js/materialize.min.js" | |
}, | |
"html": "<div id=\"app\">\n\n</div>", | |
"htmlMode": "html", |
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 <cs50.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
char shiftCipher(char c, int k) { | |
if(isupper(c)) { | |
return ((c - 65 + k) % 26) + 65; | |
} else if (islower(c)){ |
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 validateCard(digitLength, cardVal){ | |
var reverseDigits = cardVal | |
.substring(0, digitLength - 1) | |
.split('') | |
.reverse(); | |
var lastDigit = Number(cardVal.substring(digitLength - 1, digitLength)); | |
var reducedDigits = []; | |
var normalDigits = []; | |
for(var i = 0, j = Math.ceil(reverseDigits.length / 2); i < j; i++) { | |
var digit = reverseDigits[i * 2] * 2; |
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
[ | |
"Afghanistan", | |
"Åland Islands", | |
"Albania", | |
"Algeria", | |
"American Samoa", | |
"Andorra", | |
"Angola", | |
"Anguilla", | |
"Antarctica", |
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 convertTime(timestamp) { | |
const time = new Date(timestamp); | |
const hour = time.getHours(); | |
const convertedHour = ((hour + 11) % 12 + 1); | |
const minute = time.getMinutes(); | |
let meridiem = ''; | |
if (hour < 12) { | |
meridiem = 'AM'; | |
} else { | |
meridiem = 'PM'; |
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 firebase from 'firebase'; | |
const state = { | |
userId: '', | |
}; | |
const actions = { | |
login({ commit, state }, { email, password }) { | |
return new Promise((resolve, reject) => { | |
firebase.auth().signInWithEmailAndPassword(email, password) |
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 detectPhotoDimensions(photoFile) { | |
const fr = new FileReader(); | |
fr.readAsDataURL(photoFile); | |
const orientationPromise = new Promise((resolve) => { | |
fr.onload = () => { | |
const img = new Image(); | |
img.src = fr.result; | |
img.onload = () => { | |
(img.width < img.height) ? resolve(1) : resolve(2) | |
}; |
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
Vue.component('counter-buttons', { | |
template: ` | |
<div> | |
<button class="btn btn-sm btn-primary" @click="$emit('increase-count')">Increase</button> | |
<button class="btn btn-sm btn-secondary" @click="$emit('decrease-count')">Decrease</button> | |
</div> | |
` | |
}); | |
Vue.component('counter-view', { |
OlderNewer