Skip to content

Instantly share code, notes, and snippets.

View d0k1's full-sized avatar
🌐
Everything is a copy of a copy of a copy...

Denis Kirpichenkov d0k1

🌐
Everything is a copy of a copy of a copy...
View GitHub Profile
@pmuellr
pmuellr / unzip-recurse.py
Created November 19, 2010 15:41
tool to recursively unzip .zip and .jar files
#!/usr/bin/env python
import os
import sys
import subprocess
#-----------------------------------------------------------------------------
def main():
fileNames = sys.argv[1:]
@johnconroy
johnconroy / tfidf java
Created September 27, 2011 14:59
Term frequency Inverse Document Frequency Java
package tfidf;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
@hay
hay / gist:1351230
Last active March 29, 2024 16:36
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title>
<style>
body {
background: white;
text-align: center;
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@mresetar
mresetar / readMail.groovy
Created January 29, 2012 15:21
Read e-mail Groovy script
import javax.mail.*;
import javax.mail.internet.*;
@GrabConfig(systemClassLoader=true)
@Grapes(
@Grab(group='javax.mail', module='mail', version='1.4.4')
)
// setup connection
Properties props = new Properties();
def host = "localhost";
@kfox
kfox / sysctl.conf
Created February 29, 2012 17:32
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
@keesun
keesun / WebConfig.java
Created April 16, 2012 09:12
Web configuration using @configuration
package cantabille.config;
import cantabille.modules.ModulesPackageMarker;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@chrisvest
chrisvest / Notes.md
Created June 14, 2012 20:56 — forked from rednaxelafx/JDK5u22_client.log
PrintCompilation on different versions of HotSpot VM

About PrintCompilation

This note tries to document the output of PrintCompilation flag in HotSpot VM. It was originally intended to be a reply to a blog post on PrintCompilation from Stephen Colebourne. It's kind of grown too big to fit as a reply, so I'm putting it here.

Written by: Kris Mok rednaxelafx@gmail.com

Most of the contents in this note are based on my reading of HotSpot source code from OpenJDK and experimenting with the VM flags; otheres come from HotSpot mailing lists and other reading materials listed in the "References" section.

This

@termi
termi / crossBrowser_initKeyboardEvent.js
Last active June 13, 2023 02:01
Cross-browser initKeyboardEvent
void function() {//closure
var global = this
, _initKeyboardEvent_type = (function( e ) {
try {
e.initKeyboardEvent(
"keyup" // in DOMString typeArg
, false // in boolean canBubbleArg
, false // in boolean cancelableArg
, global // in views::AbstractView viewArg
@nfeldman
nfeldman / firebug-xpath.js
Last active May 11, 2017 16:51
Standalone version of XPath Module from Firebug, assumes strings have a trim method
// AMD, Node flavored CommonJS, and old fashion global
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();