Skip to content

Instantly share code, notes, and snippets.

View xcv58's full-sized avatar
๐Ÿ˜€
What's happening?

xcv58 xcv58

๐Ÿ˜€
What's happening?
View GitHub Profile
@xcv58
xcv58 / gist:8773106
Last active August 29, 2015 13:55
temp
/*
* Test fork(), pipe(), etc.
* Author: xcv58
* Date: 2/2/2014
*/
#ifndef _STDIO_H_
#define _STDIO_H_
#include <stdio.h>
#endif
@xcv58
xcv58 / show-absolute-path.sh
Last active August 29, 2015 14:06
Show Path of Shell Script File itself
SCRIPT_FILE=`which $0`
if [ -L $SCRIPT_FILE ]; then
SCRIPT_FILE=`readlink $SCRIPT_FILE`
fi
SCRIPT_PATH=`dirname $SCRIPT_FILE`
SCRIPT_FILE=`basename $SCRIPT_FILE`
echo Path: $SCRIPT_PATH
echo Filename: $SCRIPT_FILE
@xcv58
xcv58 / CustomHash.java
Created February 10, 2015 15:56
Custom Hash implementation with Java 8 Stream
import java.util.*;
import java.util.stream.*;
public class CustomHash {
public class Entry {
List<Object> list;
public Entry() {
list = new ArrayList<Object>();
}
@xcv58
xcv58 / Temp.java
Last active August 29, 2015 14:17
import java.util.*;
import java.io.*;
public class Temp {
public enum TYPE {
INT, LONG, FLOAT, DOUBLE, STRING, DATE, DECIMAL, CHAR, VARCHAR
}
private List<TYPE> list;
global foundCount
global hideCount
global frontmostCount
on toggle(appPath)
if application appPath is running then
set foundCount to foundCount + 1
if frontmost of application appPath then
if hideCount > 0 then return
set hideCount to hideCount + 1
/*
* Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
* The President and Fellows of Harvard College.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@xcv58
xcv58 / cVimrc
Last active August 29, 2015 14:18
cVim config
let blacklists = ["https://mail.google.com/*","https://inbox.google.com/*","https://trello.com/*","http://coolwanglu.github.io/*","https://www.dropbox.com/*"]
@xcv58
xcv58 / build.gradle
Last active August 31, 2015 21:38
dependsOn and overwrite conflict
task a << {
println 'task a'
}
task b(dependsOn: {a}) << { // works
// task b(dependsOn: 'a') << { // works
// task b(dependsOn: [a]) << { // doesn't work
// task b(dependsOn: a) << { // doesn't work
// task b << {
println 'task b'
@xcv58
xcv58 / quip-auto-hide-sidebar.js
Last active October 27, 2015 23:07
Quip auto hide sidebar
// inspired by http://ryanmorr.com/using-mutation-observers-to-watch-for-element-availability/
(function(win){
'use strict';
var listeners = [],
doc = win.document,
MutationObserver = win.MutationObserver || win.WebKitMutationObserver,
observer;
function ready(selector, fn){
// Store the selector and callback to be monitored
@xcv58
xcv58 / test
Last active October 28, 2015 00:16
test
console.log('Hello');