Skip to content

Instantly share code, notes, and snippets.

View ultim8k's full-sized avatar
🛠️
Rock & roll!

Kostas Kapenekakis ultim8k

🛠️
Rock & roll!
View GitHub Profile
@ultim8k
ultim8k / Foo.js
Last active April 26, 2018 09:42 — forked from dandelany/gist:1ff06f4fa1f8d6f89c5e
Recursively cloning React children
import React from 'react';
import { isObject } from 'lodash';
export class Foo extends React.Component {
recursiveCloneChildren(children) {
return React.Children.map(children, child => {
if(!isObject(child)) return child;
var childProps = {someNew: "propToAdd"};
childProps.children = this.recursiveCloneChildren(child.props.children);
return React.cloneElement(child, childProps);
@ultim8k
ultim8k / README.md
Last active April 25, 2018 16:47
SSL Me

node.js + nginx + ssl configuration for local development

TBC

@ultim8k
ultim8k / carousel-fix.css
Last active April 24, 2018 20:34
apothema
@ultim8k
ultim8k / index.html
Created March 20, 2018 11:56
pdf & screenshot generator
/**
*
* Generate screenshot and pdf from webpage
*
* Read more here:
* https://medium.com/@dschnr/using-headless-chrome-as-an-automated-screenshot-tool-4b07dffba79a
* https://github.com/GoogleChrome/puppeteer
*
*/
@ultim8k
ultim8k / quotes.md
Last active March 28, 2024 09:54
Quotes

Quotes

"The secret to happiness is freedom. And the secret to freedom is courage." -- Thucydides

"The only true law is that which leads to freedom. There is no other." -- *Richard Bach, Jonathan Livingston Seagull

"If people aren't laughing at your dreams, your dreams aren't big enough." -- Grayson Marshall

"Fear is temporary. Regret is permanent" -- Dan Skinner

@ultim8k
ultim8k / aws-static-assets.md
Last active December 9, 2018 17:18
Serve assets from AWS S3 + Cloudfront

Serve assets from AWS S3 + Cloudfront

Enabling CORS

S3 bucket setup

Go to your s3 bucket and go to Permissions and then CORS configuration. You can edit and paste the following snippet after replacing __PRODUCTION_DOMAIN__ and __LOCAL_DOMAIN__ with the real domains.

@ultim8k
ultim8k / fetch-json.js
Last active January 15, 2018 14:27
Using js fetch to GET json data
// Voila the all new JS fetch
fetch('https://bloody-data-json-url', {
method: 'GET',
// Ask API to respond with json
headers: new Headers({
'Content-Type': 'application/json'
}),
mode: 'cors',
cache: 'default'
})
@ultim8k
ultim8k / .editorconfig
Created October 31, 2017 21:32
New web project starter pack
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true