Skip to content

Instantly share code, notes, and snippets.

View speedsticko's full-sized avatar

Kwan Lim speedsticko

View GitHub Profile
@speedsticko
speedsticko / timings-parser
Created October 28, 2013 02:19
Get lines from log file contains timings, redirect repl output to fie.
(defmacro redir [filename & body]
`(binding [*out* (clojure.java.io/writer ~filename)] ~@body))
(redir "outfile.txt"
(with-open [rdr (clojure.java.io/reader "infile.txt")]
(doseq [line (filter #(.contains % "marker") (line-seq rdr))]
(println line)
)
)
)

Layouts

ALT + t: tiled windows ( []= symbol between the tag numbers and the title bar.) ALT + f: floating windows ( ><> symbol between the tag numbers and the title bar.) ALT + m: monocle windows (one fullscreen window at a time) ALT + space: move to previous mode

Stacks management

ALT + ENTER: move a windows to the master area

@speedsticko
speedsticko / gist:6106590
Created July 29, 2013 18:39
Reading file from the end
// http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace MiscUtil.IO
{
ItemView
CollectionView
Regions
onShow
Layout
Application
onRender
addInitializer
dom-dependent
@speedsticko
speedsticko / gist:5577871
Created May 14, 2013 17:34
Form inputs don't inherit font styling.
Form items (inputs/textarea/etc) don't inherit font information. You'll need to set the font-family on those items:
input, select, textarea, button{font-family:inherit;}
@speedsticko
speedsticko / MyObjectMain.cpp
Created February 7, 2013 19:08
How are objects constructed? objects, pointers, stack, heap?
#include "MyObject.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
auto o1 = new MyObject();
MyObject o2;
#include "MyObject.h"
#include <iostream>
using namespace std;
MySubObject::MySubObject(void)
{
cout<<"Constructor MySubObject"<<endl;
}
#pragma once
#include <string>
class MySubObject {
public:
MySubObject(void);
~MySubObject(void);
std::string subName;
@speedsticko
speedsticko / gist:4724510
Created February 6, 2013 18:05
dereferencing pointer to struct creates copy?
#include <iostream>
using namespace std;
typedef struct Something
{
int number;
} Something, *PSomething;
#define UPDATE_SOMETHING(something, n) (something).number = n;