This file contains hidden or 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
Date.prototype.getWeek = function () { | |
var onejan = new Date(this.getFullYear(), 0, 1); | |
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7); | |
}; | |
var myDate = new Date("2001-02-02"); | |
myDate.getWeek(); //=> 5 |
This file contains hidden or 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
//Usage | |
import React from 'react'; | |
import { BrowserRouter as Router } from 'react-router-dom'; | |
import Route from './AuthRoute'; | |
import Login from './Login'; | |
import Private from './Private'; | |
export default () => | |
<Router> |
This file contains hidden or 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
Software for the Project: | |
Raspbian Wheezy Debian Linux | |
Win32Disk Imager | |
The CanaKit comes with a pre-loaded SD card that includes the same version of Debian Wheezy that I used for this project. However, in an effort to get a little more speed out of the system, I used the 95MB/s Sandisk extreme listed above. It seemed to help, but I did not bench mark it beyond observation. | |
Anyway, lets get down to building a Raspberry Pi Web Kiosk. | |
Step 0: Get all of the hardware. | |
Step 1: Get all of the software. |
This file contains hidden or 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
<?php | |
$posts = get_posts([ | |
'post_status' => 'publish', | |
'posts_per_page' => -1, | |
'post_type' => 'abc' | |
]); | |
$post_index = array_fill_keys( array_merge( [ '#' ], range( 'a', 'z' ), ['Å', 'Ä', 'Ö', ] ), [] ); | |
foreach( $posts as $post ) { | |
$first_letter = mb_strtolower(substr( $post->post_title, 0, 1 ), 'UTF-8' ); |
This file contains hidden or 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
<?php | |
$posts = get_posts([ | |
'post_status' => 'publish', | |
'posts_per_page' => -1, | |
'post_type' => 'abc' | |
]); | |
$post_index = array_fill_keys( array_merge( [ '#' ], range( 'a', 'z' ), ['å', 'ä', 'ö', ] ), [] ); | |
foreach( $posts as $post ) { | |
$first_letter = strtolower( substr( $post->post_title, 0, 1 ) ); | |
if( is_numeric( $first_letter ) ) { |
This file contains hidden or 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 Exponent from 'exponent'; | |
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
} from 'react-native'; | |
import MapView from 'react-native-maps'; | |
import NavigationBar from 'react-native-navbar'; |
This file contains hidden or 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 Exponent from 'exponent'; | |
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
} from 'react-native'; | |
import MapView from 'react-native-maps'; | |
import NavigationBar from 'react-native-navbar'; |
This file contains hidden or 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 <iostream> | |
using namespace std; | |
int main() { | |
double provResultat[] = {3.5, 27.2, 18.2, 28.2, 11.0, 15.5, 18.5, 17.5, 19.0}; | |
double best = provResultat[0]; | |
int storlek = sizeof(provResultat)/sizeof(double); | |
for(int i = 1; i<storlek;i++) { |
This file contains hidden or 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 <iostream> | |
#include <vector> | |
using namespace std; | |
int main() { | |
vector<int> skottar; | |
vector<int> input; | |
This file contains hidden or 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 <iostream> | |
#include <iomanip> | |
#include <ctime> | |
using namespace std; | |
int main() { | |
time_t t = time(0); // initialisera tids objektet |
NewerOlder