Skip to content

Instantly share code, notes, and snippets.

View SebastianTroc's full-sized avatar

Sebastian Troć SebastianTroc

View GitHub Profile
@SebastianTroc
SebastianTroc / cloudSettings
Last active April 7, 2020 21:45
VSC settings
{"lastUpload":"2020-04-07T21:45:15.847Z","extensionVersion":"v3.4.3"}
@SebastianTroc
SebastianTroc / on-jsx.markdown
Created October 6, 2016 17:37 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

@SebastianTroc
SebastianTroc / package.json
Created May 12, 2016 19:26 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
@SebastianTroc
SebastianTroc / index.html
Last active December 17, 2015 01:28
Generator liczb pseudolosowych z wykresem liczb wylosowanych jednostek od 1 do 100
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Generator liczb pseudolosowaych</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://www.amcharts.com/lib/amcharts.js" type="text/javascript"></script>
</head>
<body>
<div id="chartdiv" style="width: 100%; height: 500px;"></div>
<script src="losowanie.js"></script>
@SebastianTroc
SebastianTroc / sort-query-posts.php
Created August 10, 2012 08:57
change plugin: Sort Query Posts with possibility to set a locale for collation
if (! function_exists('sort_query_posts_by'))
{
function sort_query_posts_by($order_by, $order = 'asc', $locale = '')
{
global $wp_query;
$order_by = strtolower($order_by);
$order = strtolower($order);
if ($order_by == 'rand') {
shuffle($wp_query->posts);
<?php
/**
* Change Admin URL
*
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@SebastianTroc
SebastianTroc / UML yuml.me do Zubka
Created June 1, 2012 09:23
Scripts for yuml.me - UML Diagrams
Diagramy stanów:
1. Toster
(start)->(zaaplikowanie chleba)->(ustawienie czasu)->(podgrzewanie)->(wyrzucenie gotowego tosta)->(end)
2. Zmywarka
(start)->(Wybierz program)-><a>[Drzwi zamkniete]->|b|,
|b|-Zablokuj>[Drzwi]->|c|,
test gist from gist-it for Android