Skip to content

Instantly share code, notes, and snippets.

View bbg's full-sized avatar
👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk

Batuhan Göksu bbg

👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk
View GitHub Profile
@bbg
bbg / css-calc.css
Created June 14, 2017 16:46 — forked from jonkemp/css-calc.css
Cross Browser CSS Calc()
/* 1. write it out for older browsers */
/* 2. use the vendor prefix for webkit */
/* 3. use the vendor prefix for moz */
/* 4. include the un-prefixed version last */
#foo {
width: 200px;
width: -webkit-calc(50% - 100px);
width: -moz-calc(50% - 100px);
width: calc(50% - 100px);
@bbg
bbg / atom-vertical-file-tabs.less
Created September 23, 2017 10:16 — forked from jasesmith/atom-vertical-file-tabs.less
For vertically stacked open file tabs, put this in your `./atom/styles.less`
atom-workspace-axis.vertical atom-pane {
flex-direction: row;
.tab-bar {
box-shadow: inset -1px 0 0 #181a1f;
resize: horizontal;
height: auto;
display: block;
padding-right: 1px;
padding-bottom: 3em;
min-width: 14em;
@bbg
bbg / index.html
Created September 29, 2017 11:48 — forked from arisetyo/index.html
Dynamic Real-time Chart Using Chart.js, Socket.io, and Knockout.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Galenic">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/knockout-2.1.0.js"></script>
<script src="js/Chart.js"></script>
<link rel="stylesheet" href="pure-min.css">
@bbg
bbg / app.js
Created December 28, 2017 12:39 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@bbg
bbg / setting-up-babel-nodemon.md
Created March 17, 2018 22:52 — forked from sam-artuso/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@bbg
bbg / sublime-text-macos-context-menu.md
Created March 18, 2018 18:09 — forked from idleberg/sublime-text-macos-context-menu.md
“Open in Sublime Text” in macOS context-menu

Open in Sublime Text

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Sublime Text
@bbg
bbg / Makefile
Created April 1, 2018 10:37
Makefile for Go Projects
GOPATH=$(shell pwd)/vendor:$(shell pwd)
GOBIN=$(shell pwd)/bin
GOFILES=$(wildcard *.go)
GONAME=$(shell basename "$(PWD)")
PID=/tmp/go-$(GONAME).pid
build:
@echo "Building $(GOFILES) to ./bin"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES)
@bbg
bbg / dropdown.js
Created April 8, 2018 07:46 — forked from blakehaswell/dropdown.js
Vanilla JS Dropdown
/**
* Given a list of items, adds and removes an active class as you hover over
* them. Used to create a dropdown menu.
*
* Copyright (c) 2012 Blake Haswell
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
* Example:
* var items = document.getElementById("dropdown").children;
* new Dropdown(items);
@bbg
bbg / filex.cr
Created May 26, 2018 21:07
Some Crystal File add-ons
module FileX
def self.mount?(path)
begin
stat_path = File.lstat(path)
rescue Errno
# It doesn't exist so not a mount point
return false
end
# A symlink can never be a mount point
@bbg
bbg / app.cr
Created June 10, 2018 12:48 — forked from cjgajard/app.cr
Kemal controllers pattern
# src/{{app_name}}.cr
require "kemal"
require "./controllers/*"
alias Env = HTTP::Server::Context # this could be provided by Kemal
module Main
get "/", &->index(Env)
get "/:name", &->greet(Env)
end