Skip to content

Instantly share code, notes, and snippets.

View mbektimirov's full-sized avatar
🦀

Marat Bektimirov mbektimirov

🦀
View GitHub Profile
# Set CLICOLOR if you want Ansi Colors in iTerm2
export CLICOLOR=1
#
# # Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function createFakeQueries(count, minTime, maxTime) {
return Array(count)
.fill()
.map((_, i) => {
const time = getRandomInt(minTime, maxTime);
const queryCaller = () =>
@mbektimirov
mbektimirov / state-from-props.coffee
Created October 14, 2014 08:16
React: state from props
module.exports = React.createClass
displayName: 'Switcher'
getInitialState: (props) ->
props ||= @props
checked: props.checked
componentWillReceiveProps: (newProps, oldProps) ->
@setState @getInitialState(newProps)
@mbektimirov
mbektimirov / SassMeister-input.scss
Created April 4, 2014 08:09
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
$module: 'TestModule';
@mixin e($element) {
.#{$module}__#{$element} {
@mbektimirov
mbektimirov / SassMeister-input.scss
Created April 4, 2014 08:05
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
$module: 'TestModule';
.#{$module} {
color: red;

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
{
"jshint_options" :
{
"adsafe": false,
"bitwise": false,
"newcap": true,
"eqeqeq": true,
"immed": true,
"nomen": false,
"onevar": true,
@mbektimirov
mbektimirov / gist:2660553
Created May 11, 2012 15:47 — forked from oxbowlakes/gist:1869377
Simple scala collection examples
scala> (1 to 20).toList
res1: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
//Simple side effects
scala> res1 take 3 foreach (i => println(i))
1
2
3
scala> res1 take 3 foreach println
@mbektimirov
mbektimirov / scala-interview1.scala
Created May 11, 2012 15:45 — forked from oxbowlakes/scala-interview1.scala
Scala interview questions
object GOption {
def some[A](a: A): GOption[A] = new GOption[A] {
def cata[B](n: => B, s: A => B): B = sys.error("Implement me")
}
def none[A]: GOption[A] = new GOption[A] {
def cata[B](n: => B, s: A => B): B = sys.error("Implement me")
}
}
trait GOption[+A] {