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
@n8henrie
n8henrie / duplicateFinderTab.applescript
Created August 2, 2014 16:44
Uses a hacky workaroud to duplicate the frontmost Finder tab, since Apple hasn't provided great AppleScript support for this.
-- duplicateFinderTab.scpt
-- Uses a hacky workaroud to duplicate the frontmost Finder tab,
-- since Apple hasn't provided great AppleScript support for this.
-- Details at:
on new_tab()
tell application "System Events" to tell application process "Finder"
set frontmost to true
tell front menu bar to tell menu "File" to tell menu item "New Tab"
perform action "AXPress"
@bcremer
bcremer / gist:12167985b442d0d195de
Created August 5, 2014 12:01
NGINX as caching REST-API Proxy
upstream backend {
server localhost:8080;
#server backup1.example.com:8080 backup;
#server backup2.example.com:8080 backup;
}
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m;
# Set cache key to include identifying components
@andreagrandi
andreagrandi / parse_json_post.go
Created August 19, 2014 13:28
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string
@Starefossen
Starefossen / remoteDataTableView.swift
Last active January 16, 2023 09:50
Remote JSON Data to tableView in iOS 8.0 (Swift)
import UIKit
import Foundation
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely()
class RemoteAPI {
func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void {
let url: NSURL = NSURL(string: "http://itunes.apple.com/search?term=Turistforeningen&media=software")
let ses = NSURLSession.sharedSession()
@ProjectCleverWeb
ProjectCleverWeb / centered.md
Last active September 20, 2023 09:46
Example of how to do centered text and images in Githb Flavored Markdown
@ixn
ixn / hello-world.c
Last active August 29, 2015 14:07
Hello World in C use Libevent
/*
This exmple program provides a trivial server program that listens for TCP
connections on port 9995. When they arrive, it writes a short message to
each client connection, and closes each connection once it is flushed.
Where possible, it exits cleanly in response to a SIGINT (ctrl-c).
*/
/* Deklarasi lib standar yang digunakan */
#include <string.h>
@nmerouze
nmerouze / main.go
Created December 5, 2014 12:07
JSON-API with Go and MongoDB: Part 2
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@ocean90
ocean90 / Default (OSX).sublime-keymap
Created December 14, 2014 14:56
Sublime Text 3 Config
[
{ "keys": ["ctrl+super+l"], "command": "sublimelinter_lint" },
{ "keys": ["ctrl+super+e"], "command": "sublimelinter_goto_error", "args": {"direction": "next"} },
{ "keys": ["ctrl+super+shift+e"], "command": "sublimelinter_goto_error", "args": {"direction": "previous"} },
{ "keys": ["ctrl+super+b"], "command": "sublimelinter_show_all_errors" },
{ "keys": ["super+ctrl+a"], "command": "alignment" },
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
]
@lantins
lantins / Makefile
Created January 11, 2015 01:35
"Auto build & serve" of golang code :)
#
# Makefile to perform "live code reloading" after changes to .go files.
#
# n.b. you must install fswatch (OS X: `brew install fswatch`)
#
# To start live reloading run the following command:
# $ make serve
#
# binary name to kill/restart

Kemal Crystal v0.10.0 vs new-fibers

This benchmark demonstrates the new-fibers improvements via Kemal.

# app.cr
require "kemal"

get "/" do
 "Hello World"