Skip to content

Instantly share code, notes, and snippets.

@hute37
hute37 / gist:f9c0dc764cb425da8785
Created October 24, 2014 12:07
Gnome-3-Performance-Tweaks
##
# @see: http://penguininside.blogspot.it/2009/08/top-10-gnome-performance-tweaks.html
#
gconftool-2 --type string --set /apps/nautilus/preferences/show_icon_text never
gconftool-2 --type string --set /apps/nautilus/preferences/show_directory_item_counts never
gconftool-2 --type string --set /apps/nautilus/preferences/show_image_thumbnails never
gconftool-2 --type string --set /apps/nautilus/preferences/preview_sound never
# gconftool-2 --type bool --set /desktop/gnome/interface/menus_have_icons false
@hute37
hute37 / mathjax-addition
Created January 17, 2016 13:41 — forked from jeromyanglim/mathjax-addition
mathjax code
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/javascript">MathJax.Hub.Config({tex2jax: {processEscapes: true,
processEnvironments: false, inlineMath: [ ['$','$'] ],
displayMath: [ ['$$','$$'] ] },
asciimath2jax: {delimiters: [ ['$','$'] ] },
"HTML-CSS": {minScaleAdjust: 125 } });
</script>
@hute37
hute37 / readme.Rmd
Created January 19, 2016 23:17 — forked from yihui/readme.Rmd
A list of package vignettes built from knitr on CRAN
Here is a list of package vignettes _possibly_ built with **knitr** on CRAN.
```{r fetch-pkgs, include=FALSE}
pkgs = available.packages(contrib.url('http://cran.r-project.org', 'source'))
deps = tools::package_dependencies('knitr', pkgs, which = 'all', reverse = TRUE)[['knitr']]
deps = setdiff(deps, 'R.rsp') # packages that do not use knitr
deps = sort(c(deps, 'knitr'))
```
```{r vig-list, include=FALSE, echo=FALSE, cache=TRUE, cache.extra=deps, message=FALSE, error=FALSE}
vigs = lapply(deps, function(pkg) {
@hute37
hute37 / logistic_regression.R
Created August 15, 2016 22:36 — forked from mick001/logistic_regression.R
Logistic regression tutorial code. Full article available at http://datascienceplus.com/perform-logistic-regression-in-r/
# Load the raw training data and replace missing values with NA
training.data.raw <- read.csv('train.csv',header=T,na.strings=c(""))
# Output the number of missing values for each column
sapply(training.data.raw,function(x) sum(is.na(x)))
# Quick check for how many different values for each feature
sapply(training.data.raw, function(x) length(unique(x)))
# A visual way to check for missing data
; Stumbling towards Y
;
; The applicative-order Y combinator is a function that allows one
; to create a recursive function without using define.
; This may seem strange. Usually a recursive function has to call
; itself, and thus relies on itself having been defined.
;
; Regardless, here we will stumble towards the implementation of the
; Y combinator (in Scheme).
@hute37
hute37 / 00-OozieWorkflowShellAction
Created September 27, 2016 08:28 — forked from airawat/00-OozieWorkflowShellAction
Oozie workflow with a shell action - with CaptureOutput Counts lines in a glob provided and writes the same to standard output. A subsequent email action emails the output of the shell action
This gist includes components of a oozie workflow - scripts/code, sample data
and commands; Oozie actions covered: shell action, email action
Action 1: The shell action executes a shell script that does a line count for files in a
glob provided, and writes the line count to standard output
Action 2: The email action emails the output of action 1
Pictorial overview of job:
--------------------------
@hute37
hute37 / email_utils.py
Created October 2, 2016 15:26 — forked from rjurney/email_utils.py
My Pig script and Python Streaming Stuff
#!/opt/local/bin/python
import imaplib
import sys, signal
from avro import schema, datafile, io
import os, re
import email
import inspect, pprint
import getopt
import time
import java.math.{BigDecimal => BD, MathContext}
import BD.{ZERO, ONE}
/**
* This program will calculate Pi with John Machin[1]'s formula[2].
* This is just a translation from Mr. Kishida's Java implementation[3] to
* Scala one.
*
* [1] http://en.wikipedia.org/wiki/John_Machin
* [2] http://upload.wikimedia.org/math/f/1/5/f15dc3d39c473c4bd718e3a98145da0d.png
@hute37
hute37 / bash-cheatsheet.sh
Created July 29, 2017 21:57 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@hute37
hute37 / kalgn-enum-planets.scala
Created April 3, 2018 21:00 — forked from d6y/kalgn-enum-planets.scala
Planets Example using Klang DIY Enum
/*
The Oracle Java enum Planets example using the Klang DIY Enum, modified to include ordering.
*/
object KlangEnumPlanets extends App {
trait Enum { //DIY enum type
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia
type EnumVal <: Value //This is a type that needs to be found in the implementing class