Skip to content

Instantly share code, notes, and snippets.

@barik
barik / gist:3140646
Created July 19, 2012 03:47
Sumatra PDF with Emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(TeX-PDF-mode t)
'(TeX-master nil)
'(TeX-source-correlate-method (quote synctex))
'(TeX-source-correlate-mode t)
'(TeX-source-correlate-start-server (quote ask))
/* BOOL fnEditPath(char *ExistingPath);
*
* Function will add the szSetupPath to the users path statement in the
* autoexec.bat file. The szSetupPath will be the first location in the
* path statement. The path can be in about a million fucked up forms
* depending on the level of stupidity in the user. Here are a few to
* think about. DOS will accept any of these.
*
* PATH=C:\foo;C:\foobar;...
* SET PATH=C:\foo;C:\foobar;...
// Some type of object without properties can be shortcutted.
if (keys.length === 0) {
if (typeof value === 'function') {
var name = value.name ? ': ' + value.name : '';
return ctx.stylize('[Function' + name + ']', 'special');
}
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
}
if (isDate(value)) {
@barik
barik / gist:3299055
Created August 8, 2012 21:44
ciigar firewall
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
@barik
barik / gist:3354739
Created August 15, 2012 01:52
org-mode indent
#+BEGIN
for x in range(1,6):
print x
#+END
@barik
barik / gist:3366009
Created August 16, 2012 02:57
Conferences
| Conference Name | Date | URL |
|-----------------+---------------+-------------------------------------------|
| FIE | January 1 | http://www.fie2012.org |
| IJCAI | January 9 | http://ijcai.org/ |
| AAAI | January 20 | http://www.aaai.org/ |
| KDD | February 10 | http://www.kdd.org/ |
| DiGRA | February 12 | http://www.digra.org/ |
| OOPSLA | April 13 | http://splashcon.org/2012/ |
| CIG | April 15 | http://www.ieee-cig.org/ |
| UIST | April 22 | http://www.acm.org/uist/uist2011/ |
@barik
barik / gist:3703491
Created September 12, 2012 01:23
Cognitive model for counting
CL-USER> (run 1)
0.000 GOAL SET-BUFFER-CHUNK GOAL FIRST-GOAL REQUESTED NIL
0.000 PROCEDURAL CONFLICT-RESOLUTION
0.000 PROCEDURAL PRODUCTION-SELECTED START
0.000 PROCEDURAL BUFFER-READ-ACTION GOAL
0.050 PROCEDURAL PRODUCTION-FIRED START
0.050 PROCEDURAL MOD-BUFFER-CHUNK GOAL
0.050 PROCEDURAL MODULE-REQUEST RETRIEVAL
0.050 PROCEDURAL CLEAR-BUFFER RETRIEVAL
0.050 DECLARATIVE START-RETRIEVAL
@barik
barik / gist:4082925
Created November 16, 2012 00:57
Generics for Donghoon
Step 0: Java Generics
Step 1:
A lesson on generics can be found here:
http://docs.oracle.com/javase/tutorial/java/generics/
JLS is at (search Generic):
http://docs.oracle.com/javase/specs/jls/se7/html/index.html
@barik
barik / gist:4236736
Created December 7, 2012 21:36
break message
message = "ABC[DE]F[GH]I"
def breakmessage(message):
brace = False
out = []
for s in message:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 5154K 1292M RH-Firewall-1-INPUT all -- any any anywhere anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 RH-Firewall-1-INPUT all -- any any anywhere anywhere
Chain OUTPUT (policy ACCEPT 554K packets, 172M bytes)
num pkts bytes target prot opt in out source destination