Skip to content

Instantly share code, notes, and snippets.

View saigowthamr's full-sized avatar
🐢
I may be slow to respond.

Sai gowtham saigowthamr

🐢
I may be slow to respond.
View GitHub Profile
const script = document.createElement("script");
script.src = "https://s3.buysellads.com/ac/bsa.js";
script.async = true;
const first = document.querySelector(".first");
const iframe = document.querySelector("iframe");
const btn = document.querySelector("button");
btn.addEventListener("click", () => {
var html = first.textContent;
iframe.src = "data:text/html;charset=utf-8," + encodeURI(html);
});
(function (modules) {
function require(name) {
const [fn] = modules[name];
const module = {},exports={};
fn(module, exports,(name)=>require(name));
return exports;
}
require("./getSum");
})({"./getSum": [
function ( module, exports,require) {
import React, { Component } from "react";
import CounterButtons from "./counterbuttons";
import Text from "./text";
import Todo from "./todo";
import FetchData from "./fetch";
import { getState} from "./store";
class App extends Component {
render() {
return (
import React from 'react';
import { getState, dispatch} from './store'
class Todo extends React.Component {
OnAddHandler = () => {
if (this.input.value)
dispatch({
type: 'ADD_TODO',
text: this.input.value
})
const initalState = {
num: 0,
todos: [],
data: "",
users:null
}
function reducer(action, state =initalState ) {
switch (action.type) {
case "INC":
import { reducer } from './reducers'; //import your reducer
let state;
const getState = () => state;
const listeners = [];
const dispatch = action => {
state = reducer(action, state);
listeners.forEach(listener => listener())
};
class App extends React.Component {
render() {
return (
<Accordion>
<Heading>Heading 1</Heading>
<Text>
“You've gotta dance like there's nobody watching, Love like you'll
never be hurt, Sing like there's nobody listening, And live like it's
heaven on earth.” ― William W. Purkey
</Text>
@saigowthamr
saigowthamr / social-share-url-patterns.txt
Created June 23, 2018 14:11 — forked from maheshwaghmare/social-share-url-patterns.txt
Social Share URL Patterns. E.g. Facebook, Twitter, Google+, Pintrest, LinkedIn, Buffer, Digg etc.
Sharer : https://www.facebook.com/sharer.php?u={url}
Twitter : https://twitter.com/intent/tweet?url={url}&text={title}&via={via}&hashtags={hashtags}
Google : https://plus.google.com/share?url={url}
Pinterest : https://pinterest.com/pin/create/bookmarklet/?media={img}&url={url}&is_video={is_video}&description={title}
LinkedIn : https://www.linkedin.com/shareArticle?url={url}&title={title}
Buffer : https://buffer.com/add?text={title}&url={url}
Digg : http://digg.com/submit?url={url}&title={title}
Tumblr : https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={desc}
Reddit : https://reddit.com/submit?url={url}&title={title}
StumbleUpon : http://www.stumbleupon.com/submit?url={url}&title={title}
@saigowthamr
saigowthamr / server.js
Created June 18, 2018 02:45
graphql apollo
const { gql, ApolloServer } = require('apollo-server');
const personType = gql`
type Person{
name:String!
age:Int!
}
type Query {