Skip to content

Instantly share code, notes, and snippets.

View jurekbarth's full-sized avatar
🔥
Focusing

Jurek Barth jurekbarth

🔥
Focusing
View GitHub Profile
@jurekbarth
jurekbarth / copySDF.js
Created August 28, 2019 08:13
copy ns files
'use strict';
const fs = require('fs');
const path = require('path');
const rimraf = require('rimraf');
// Please update accordingly every time
const definitions = [];
// Please update accordingly every time
const files = ['tado_creditmemo_ui_cust_sl.js', 'tado_creditmemo_ui_cust_ue.js'];
@jurekbarth
jurekbarth / index.js
Created March 1, 2019 15:05
SSR Webcomponents
const puppeteer = require('puppeteer');
const fs = require('fs');
const templateLiteral = '`';
const writeFile = (filename, content) => new Promise((res, rej) => {
fs.writeFile(filename, content, function (err) {
if (err) {
console.log(err)
rej(err);
@jurekbarth
jurekbarth / App.tsx
Created February 18, 2019 14:21
React Typescript
import React, { Component } from 'react';
import './App.css';
class Input extends Component<any, any> {
private textInput: React.RefObject<HTMLInputElement>;
constructor(props: any) {
super(props);
this.textInput = React.createRef();
}
render() {
@jurekbarth
jurekbarth / cognito.go
Last active December 28, 2018 07:31
AWS Cognito Add Confirmed User
package main
import (
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider"
)
@jurekbarth
jurekbarth / gist:368fa6a41188f2d951635b9666b5e856
Last active December 10, 2018 14:35
Node install binary to NPM folder
const os = require('os');
const fs = require('fs');
const path = require('path');
const https = require('https');
const unzip = require('unzip-stream');
const zlib = require('zlib');
const platform = os.platform();
const arch = os.arch();
@jurekbarth
jurekbarth / chicken-egg.js
Created November 22, 2018 08:21
chicken-egg
const element = document.getElementById('big');
const chickenEggProblem = ['🥚', '🐔'];
const sorted = chickenEggProblem.sort();
element.innerHTML = sorted.join(' ');
console.log(sorted); // 🐔 🥚
@jurekbarth
jurekbarth / index.html
Last active January 27, 2018 21:47
Intersection Obeserver
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
@jurekbarth
jurekbarth / DateInput.js
Created February 3, 2017 15:52
airbnb/react-dates DateInput iOS Fix
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
<?php
function get_tweets($url) {
$json_string = file_get_contents('http://urls.api.twitter.com/1/urls/count.json?url=' . $url);
$json = json_decode($json_string, true);
return intval( $json['count'] );
}
function get_shares($url) {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Awesome Freeletics Email</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
/* CLIENT-SPECIFIC STYLES */
#outlook a{padding:0;} /* Force Outlook to provide a "view in browser" message */
.ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} /* Force Hotmail to display normal line spacing */