Skip to content

Instantly share code, notes, and snippets.

View cenan's full-sized avatar
👻
dead

cenan ozen cenan

👻
dead
View GitHub Profile
set -g default-terminal "screen-256color"
set -g base-index 1
setw -g mode-keys vi
bind-key | split-window -h
bind-key - split-window -v
bind-key -n C-S-Left select-window -t -1
bind-key -n C-S-Right select-window -t +1
setw -g status-bg colour60
setw -g status-fg colour250
set -g window-status-current-style bg=colour69,fg=colour255
import * as fs from "fs";
import * as path from "path";
import * as express from 'express';
import * as bodyParser from "body-parser";
import { Server, ServerConfig } from "./Server";
import { deserialize } from "serializr";
let serverConfig: ServerConfig = {
httpPort: 4444,
redisHost: "127.0.0.1",
module Extensions::ActiveRecord::FindByOrderedIds
extend ActiveSupport::Concern
module ClassMethods
def find_ordered(ids)
order_clause = "CASE id "
ids.each_with_index do |id, index|
order_clause << sanitize_sql_array(["WHEN ? THEN ? ", id, index])
end
order_clause << sanitize_sql_array(["ELSE ? END", ids.length])
where(id: ids).order(order_clause)
@cenan
cenan / geocode.js
Created July 12, 2017 12:33
geocode
var geocoder;
var map;
var marker;
function initialize() {
console.log("MAPS INITIALIZED");
var myLatlng = new google.maps.LatLng($("#event_latitude").val(), $("#event_longitude").val())
var mapOptions = {
zoom: 15,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
import {add, sub} from "./ops.js";
add(1,2);
import ops from "./ops.js"
ops.add(1,2);
@cenan
cenan / go_kaynaklari.md
Last active January 6, 2016 22:48
Çeşitli Golang Kaynakları
# Tasks for managing Unicorn instances of a Rails application.
# Compatible with Ruby >= 1.9.2 and Rails >= 2 .
# Unicorn signals: http://unicorn.bogomips.org/SIGNALS.html
namespace :unicorn do
class UnicornPIDError < StandardError; end
def rails_env
Rails.env
var Twit = require("twit");
var config = require('./oauthconfig');
console.log("config:");
console.log(config);
var T = new Twit({
consumer_key: config.consumer_key,
consumer_secret: config.consumer_secret,
access_token: config.access_token,
@cenan
cenan / reload css
Created August 11, 2013 00:09
reloads css
function reloadStylesheets () {
var queryString = '?reload=' + new Date().getTime();
jQuery('link[rel="stylesheet"]').each(function () {
this.href = this.href.replace(/\?.*|$/, queryString);
});
}