Skip to content

Instantly share code, notes, and snippets.

View f's full-sized avatar
:octocat:
open sourcing

Fatih Kadir Akın f

:octocat:
open sourcing
View GitHub Profile
@f
f / allow-me.sh
Created November 2, 2017 10:29
allow-me
curl https://github.com/your-username.keys >> ~/.ssh/authorized_keys
(function ($) {
$.module = function (module, selector) {
var name = btoa(module).replace(/\W|\=/g,"")
var el = selector.split(/\s+/).map(function (sub_selector) {
return sub_selector.replace(/^([\.#])(.*)/g, function (_, f, s) {
return f + name + "_" + s
})
}).join(" ")
return $(el)
}
module CssModulesHelper
class Styler
def initialize(component)
@component = encode_module_name(component)
end
def encode_module_name(name)
Base64.encode64(name).gsub(/\W/, "")
end
def style(name)
[@component, name].join("_")
require 'css_parser'
class CSSModules
# Global Modules
# :global .button { color: red }
RE_GLOBAL = /^\:g(lobal)?\s+/
# Module Scopes
# :module(login) { .button {color: red;} }
RE_MODULE = /^\:module\((.*?)\)\s+(.*)/
@f
f / box.js
Created April 21, 2016 14:29
function box() {
var color = '#' + Math.random().toString(16).substr(-6);
var heights = [30, 50, 70, 90, 100, 120];
var randomHeight = heights[Math.floor(Math.random() * heights.length)];
var box = document.createElement('div');
box.className = 'box';
box.style.backgroundColor = color;
box.style.height = randomHeight + "px";
return box;
}
//= require ./vendors
//= require jquery_ujs
//= require react_ujs
//= require ./actions.js
//= require ./reducers.js
//= require ./store.js
//= require_tree ./components/
//= require ./base/application
//= require ./base/root
@f
f / vendors.js
Last active October 23, 2019 20:29
// This modules will be required from Node modules
// It keeps the actual modules at latest version.
window.jQuery = require('jquery');
window.React = require('react');
window.ReactDOM = require('react-dom');
window.Redux = require('redux');
window.ReactRedux = require('react-redux');
module Kamber
get "/" do
post_title = "hey"
post_text = File.read "posts/example-post.md"
render "src/kamber/views/index.ecr"
end
end
@f
f / ChangeLog.md
Last active August 29, 2015 14:13
Askerlik ile ilgili not ve şafak bilgisini burada tutmayı planlıyorum.

Askerlik Changelog

0.0.1 / 2015-02-23 - Ş:N/A

  • Yerim sabah 10:00'dan sonra belli oldu:
    • Acemilik: 15. Piyade Eğitim Tugayı, 12. Piyade Eğitim Alayı, Amasya Merkez, Amasya
    • Ustalık: 3. Ordu Karargah ve Destek Grup Lojistik Destek Komutanlığı, Bakım Birliği, Erzincan Merkez, Erzincan
  • 4 Şubat 2015 tarihinde THY ile Amasya / Merzifon'a uçakla gidip teslim olacağım.

0.0.0 / 2015-01-21 - Ş:N/A

  • Yerlerin açıklanmasına 2 gün var. Henüz yerim belli değil.
@f
f / flux.js
Created August 20, 2014 11:56
var Dispatcher = _.clone(Backbone.Events);
var SomeCollection = Backbone.Collection.extend({
initialize: function () {
Dispatcher.on('somethingHappened', this.addItem);
},
addItem: function (model) {
this.push(model);
}
});