What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-06 02:40:15
random date generator javascript
var dob; //set a range of years var min = 1900; var max = 2004; // Math.ceil prevents the value from being 0; var month = Math.ceil(Math.random() * 12); var day = Math.ceil(Math.random() * 28); var year = Math.floor(Math.random() * (max - min) + min); ... Add solution -
Javascript 2022-03-06 00:30:47
convert rgb value in hexadecimal system
function convertRgb(rgb) { // This will choose the correct separator, if there is a "," in your value it will use a comma, otherwise, a separator will not be used. var separator = rgb.indexOf(",") > -1 ? "," : &quo... Add solution -
Python 2022-03-02 20:00:07
pandas join two series on index
# credit to Stack Overflow user in the source link s1 = pd.Series([1, 2], index=['A', 'B'], name='s1') s2 = pd.Series([3, 4], index=['A', 'B'], name='s2') pd.concat([s1, s2], axis=1) Out: s1 s2 A 1 3 B 2 4 pd.concat([s1, s2], axis=1).reset_... Add solution -
Other 2022-03-02 16:35:02
apollo client set headers on each request
import { ApolloClient, HttpLink, ApolloLink, InMemoryCache, concat } from '@apollo/client'; const httpLink = new HttpLink({ uri: '/graphql' }); const authMiddleware = new ApolloLink((operation, forward) => { // add the authorization to the headers ... Add solution