Skip to content

Instantly share code, notes, and snippets.

View umurgdk's full-sized avatar

Umur Gedik umurgdk

View GitHub Profile
@umurgdk
umurgdk / test.js
Created October 20, 2013 11:35
just for test
!(function () {
console.log('hello world');
});
@umurgdk
umurgdk / index.html
Last active December 28, 2015 22:09 — forked from milkbread/index.html
<!DOCTYPE html>
<!--Source: http://danzel.github.io/Leaflet.utfgrid/example/map.html//-->
<html>
<head>
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.css" />
<script src="http://danzel.github.io/Leaflet.utfgrid/src/leaflet.utfgrid.js"></script>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
@umurgdk
umurgdk / status.ex
Last active January 1, 2016 04:09
websocket handler for cowboy
defmodule CowboyBook.Handlers.Status do
def init({:tcp, :http}, req, opts) do
{:upgrade, :protocol, :cowboy_websocket}
end
def websocket_init(transport_name, req, _opts) do
:erlang.start_timer(1000, self(), "Hello!")
{:ok, req, nil}
end
@umurgdk
umurgdk / gist:8099402
Created December 23, 2013 15:52
Mix error after application's name and project's folder name changed.
Unchecked dependencies for environment dev:
* ranch (git://github.com/extend/ranch.git)
could not find an app file at _build/shared/lib/ranch/ebin/ranch.app, this may happen when you specified the wrong application name in your deps or if the dependency did not compile (which can be amended with `mix deps.compile`)
* cowlib (git://github.com/extend/cowlib.git)
could not find an app file at _build/shared/lib/cowlib/ebin/cowlib.app, this may happen when you specified the wrong application name in your deps or if the dependency did not compile (which can be amended with `mix deps.compile`)
* cowboy (git://github.com/extend/cowboy.git)
could not find an app file at _build/shared/lib/cowboy/ebin/cowboy.app, this may happen when you specified the wrong application name in your deps or if the dependency did not compile (which can be amended with `mix deps.compile`)
** (Mix) Can't continue due to errors on dependencies
@umurgdk
umurgdk / mix.exs
Last active January 1, 2016 05:49
mix failing on heroku
defmodule ChatExperiment.Mixfile do
use Mix.Project
def project do
[ app: :chat_experiment,
version: "0.0.1",
elixir: "~> 0.12.0",
deps: deps ]
end
@umurgdk
umurgdk / dumb_module.ex
Created December 28, 2013 02:04
elixir @type, @SPEC test
defmodule DumbModule do
@type dumb_type :: :a | :b
@spec dumb_function(dumb_type) :: dumb_type
def dumb_function(_data) do
:c
end
end
@umurgdk
umurgdk / colors.js
Last active August 29, 2015 14:05
bunch of triangles made with p5.js
var Colors = [
[142, 161, 108],
[194, 207, 48],
[254, 199, 0],
[255, 137, 0],
[211, 67, 43],
[187, 41, 82],
[142, 30, 95],
[222, 74, 182],
[153, 0, 236],
defmodule Feedme.Parsers.RSS2 do
alias Feedme.Feed
alias Feedme.Entry
alias Feedme.MetaData
alias Feedme.Image
alias Feedme.Enclosure
def valid?(document) do
has_version = document
|> XmlNode.first("/rss")
@umurgdk
umurgdk / .vimrc
Created September 13, 2015 02:23
" source ~/.vim/dwiw-loader.vim
set nocompatible
filetype off
"set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"Plugins
macro choice(*parsers)
current_column = @column_number
begin
{% for name, index in parsers %}
{{name}}
{% if index < parsers.size - 1 %}
rescue
{% end %}
end
end