Skip to content

Instantly share code, notes, and snippets.

Michał Załęcki MichalZalecki

Block or report user

Report or block MichalZalecki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View draw-svg-stroke.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Draw SVG stroke</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css"/>
<style>
.content {
max-width: 800px;
@MichalZalecki
MichalZalecki / angular-isolated-scope-function-parameter.html
Last active Aug 29, 2015
AngularJS: Isolated scope and function parameter
View angular-isolated-scope-function-parameter.html
<!DOCTYPE html>
<html ng-app="myApp" ng-controller="myApp.myCtrl">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.js"></script>
<meta charset="utf-8">
<title>AngularJS: Isolated scope and function parameter</title>
</head>
<body>
<h1>AngularJS: Isolated scope and function parameter</h1>
<a href="http://jsbin.com/qeqezaqaxo/4/edit?html,js,console">see at jsBin</a>
View ContextCmder-Disable.reg
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@MichalZalecki
MichalZalecki / arrow-functions.js
Last active Aug 29, 2015
ECMAScript 6 features
View arrow-functions.js
let square = x => x * x;
let triangleArea = (a, h) => a*h/2;
let triangleHeron = (a, b, c) => {
let p = (a + b + c)/2;
return Math.sqrt(p*(p-a)*(p-b)*(p-c));
};
let objectify = x => ({ value: x });
@MichalZalecki
MichalZalecki / rails-gmail.rb
Last active Nov 8, 2019
Gmail configuration for Rails
View rails-gmail.rb
# /config/environments/development.rb
# Gmail configuration
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'example.com',
user_name: ENV['EMAIL_USER'],
View rails-disable-auto-junk.rb
# /config/environments/development.rb
config.generators.assets = false
config.generators.helper = false
config.generators.view_specs = false
config.generators.helper_specs = false
View wtf.js
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
@MichalZalecki
MichalZalecki / footer.js
Created Sep 2, 2015
React Templates vs JSX
View footer.js
@MichalZalecki
MichalZalecki / style.js
Created Oct 24, 2015
Script transpiling CSS with cssnext
View style.js
const cssnext = require("cssnext");
const fs = require("fs");
const watch = require("node-watch");
const program = require("commander");
program
.version("0.0.1")
.option("-s, --source [path]", "Source file")
.option("-d, --destination [path]", "Destination file")
.option("-w, --watch [path]", "Watch directory")
View match.ts
function match<T, S>(value: T) {
let result: ()=>S;
const context = {
caseOf(fn:(value: T) => boolean, payload: ()=>S) {
if (!result && fn(value)) result = payload;
return context;
},
_(payload: ()=>S) {
if (!result) result = payload;
return context;
You can’t perform that action at this time.