Skip to content

Instantly share code, notes, and snippets.

View mbektimirov's full-sized avatar
🦀

Marat Bektimirov mbektimirov

🦀
View GitHub Profile
@mbektimirov
mbektimirov / hack.sh
Created April 9, 2012 01:30 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mbektimirov
mbektimirov / 3nightclubs.scala
Created May 11, 2012 15:41 — forked from oxbowlakes/3nightclubs.scala
A Tale of 3 Nightclubs
/**
* Part Zero : 10:15 Saturday Night
*
* (In which we will see how to let the type system help you handle failure)...
*
* First let's define a domain. (All the following requires scala 2.9.x and scalaz 6.0)
*/
import scalaz._
import Scalaz._
@mbektimirov
mbektimirov / scala-interview2.scala
Created May 11, 2012 15:44 — forked from oxbowlakes/scala-interview2.scala
Scala interview questions hard
trait MyList[+A] {
def fold[B](k: Option[(A, B)] => B): B
def map[B](f: A => B): MyList[B] = sys.error("Implement me in terms of fold")
def flatMap[B](f: A => MyList[B]): MyList[B] = sys.error("Implement me in terms of fold")
def headOption: Option[B] = sys.error("Implement me in terms of fold")
def tailOption: Option[MyList[B]] = sys.error("Implement me in terms of fold")
def isEmpty = sys.error("Implement me in terms of fold")
def length = sys.error("Implement me in terms of fold")
}
@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] {
@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
{
"jshint_options" :
{
"adsafe": false,
"bitwise": false,
"newcap": true,
"eqeqeq": true,
"immed": true,
"nomen": false,
"onevar": true,
# 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'

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
@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;
@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} {