Skip to content

Instantly share code, notes, and snippets.

View usirin's full-sized avatar

Umut Sirin usirin

View GitHub Profile
@usirin
usirin / gist:2816626
Created May 28, 2012 01:11 — forked from smonteverdi/gist:1993724
HTML: HTML5 Starter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 Starter</title>
<link rel="stylesheet" href="" type="text/css" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@usirin
usirin / reset.css
Created May 28, 2012 01:16
CSS: reset.css
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ul, li,
form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
@usirin
usirin / center to screen
Created February 18, 2013 11:45
Centering a frame into screen.
// centering the images inside.
CGSize boundsSize = self.view.bounds.size;
CGRect frameToCenter = imageView.frame;
// center horizontally
if (frameToCenter.size.width < boundsSize.width)
frameToCenter.origin.x = (boundsSize.width - frameToCenter.size.width) / 2;
else
frameToCenter.origin.x = 0;
(function () {
/**
* Constructor of LoggedIn SVG
* object. Inherits its properties from
* caq.raphael.Main object.
* @return {caq.raphael.LoggedIn} Main paper to work on.
*/
caq.raphael.LoggedIn = function() {
// start inheritance from the Main class.
@usirin
usirin / show-session-variables.jsp
Created January 22, 2014 15:51
Show all session variables on JSP pages
Enumeration keys = session.getAttributeNames();
while (keys.hasMoreElements())
{
String key = (String)keys.nextElement();
out.println(key + ": " + session.getValue(key) + "<br>");
}
set rtp+=$HOME/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
""""""""""""""""""
"" LOW LEVEL SETUP
""""""""""""""""""
filetype on
filetype indent on
@usirin
usirin / cube_root.go
Last active August 29, 2015 14:01
gotour
package main
import (
"fmt"
"math/cmplx"
)
func Cbrt(x complex128) complex128 {
z := complex128(2)
s := complex128(0)
base64ToBinary = (uri) ->
raw = window.atob(uri)
rawLength = raw.length
array = new Uint8Array(new ArrayBuffer(rawLength))
for i in [0...rawLength]
array[i] = raw.charCodeAt i
return array
.vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@usirin
usirin / tmux.md
Created September 29, 2015 09:29 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a