Skip to content

Instantly share code, notes, and snippets.

@fkrauthan
fkrauthan / TLSSocketFactory.java
Last active January 7, 2023 04:09
Custom SSLSocketFactory Implementation to enable tls 1.1 and tls 1.2 for android 4.1 (16+)
package net.cogindo.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
RUBY_GC_HEAP_FREE_SLOTS=600000
RUBY_GC_HEAP_GROWTH_FACTOR=1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000
RUBY_GC_HEAP_INIT_SLOTS=600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3
RUBY_GC_MALLOC_LIMIT=64000000
RUBY_GC_OLDMALLOC_LIMIT=64000000
RUBY_HEAP_FREE_MIN=12500
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_HEAP_SLOTS_INCREMENT=100000
@bf4
bf4 / comment.md
Created July 8, 2014 15:58
invalid %-encoding error in application for malformed uri

Question re: should this be rack's job

# config.ru
run ->(env) {
  [ 200, { 'Content-Type' => 'text/html', }, [Rack::Request.new(env).params.inspect] ]
}
@tsmango
tsmango / deploy.rb
Last active November 6, 2015 21:22
Rails Rumble 2013 - Official Linode StackScript - Capistrano Deployment Recipe
require 'bundler/capistrano'
# This capistrano deployment recipe is made to work with the optional
# StackScript provided to all Rails Rumble teams in their Linode dashboard.
#
# After setting up your Linode with the provided StackScript, configuring
# your Rails app to use your GitHub repository, and copying your deploy
# key from your server's ~/.ssh/github-deploy-key.pub to your GitHub
# repository's Admin / Deploy Keys section, you can configure your Rails
# app to use this deployment recipe by doing the following:
@PeeHaa
PeeHaa / arrays.md
Created August 31, 2012 13:34
If I see one more question about arrays in PHP...

Arrays can be seen as lists which can hold information. Arrays in PHP can holds all types of values like scalar values, objects or even other arrays.

Declaring an initializing arrays

First lets see how we can declare an empty array:

<?php
$theArray = array();
@gaurish
gaurish / gist:2490212
Created April 25, 2012 14:36
Get status of a http request in single line code
ruby -e "require 'open-uri'; open('http://google.com'){|response| print response.status}"
#["200", "OK"]
@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8