Skip to content

Instantly share code, notes, and snippets.

View frantic's full-sized avatar
👾

Alex Kotliarskyi frantic

👾
View GitHub Profile
'CS47SI: 01. Initial State':
'prefix': 'std_initial_state'
'body': """
const initialStoreState = {
todos: [
{ id: 1, title: 'Build TODO app in under 1 hour', done: false },
{ id: 2, title: 'Prepare slides', done: false },
{ id: 3, title: 'Eat some cake', done: true },
@frantic
frantic / .flowconfig
Last active August 20, 2017 17:29
Problem with Flow React HoC with cross modules deps
[ignore]
[include]
[libs]
[lints]
[options]
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
@frantic
frantic / .phoenix.js
Last active October 23, 2015 16:54
My Pheonix 2.0 config file
var mod = ['ctrl', 'cmd', 'alt'];
var handlers = [];
function moveWindow(window, shiftX, width, shiftY, height) {
var screen = Screen.mainScreen().visibleFrameInRectangle();
var newFrame = {
x: screen.x + screen.width * shiftX,
y: screen.y + screen.height * shiftY,
width: screen.width * width,
height: screen.height * height,
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with the aha Ansi HTML Adapter. http://ziz.delphigl.com/tool_aha.php -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8" />
<title>stdin</title>
</head>
<body>
<pre>
var Deck = React.createClass({
getInitialState: function() {
return {
slide: this.props.firstSlide,
following: true,
likedSlides: {}
};
},
});
@frantic
frantic / gist:4742429
Created February 8, 2013 22:21
Bash magic
^X ^E # edit command in $EDITOR, then execute it
!$ # last argument of last command
!:n # n-th argument of last command
@frantic
frantic / git-tricks.sh
Created January 29, 2013 15:24
Git secrets I didn't know about
# Show inline diff
git diff HEAD^ --word-diff
# Turn on autocorrection ("comit" -> "commit")
git config --global help.autocorrect 1
# Ultimate blame
git blame -w -CCC
# Get a file from different branch/rev