Skip to content

Instantly share code, notes, and snippets.

View karuna's full-sized avatar
🦡
Badger Badger Badger

Karuna Murti karuna

🦡
Badger Badger Badger
View GitHub Profile
@karuna
karuna / 2019-https-localhost.md
Created April 20, 2024 12:38 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@karuna
karuna / rocketguide.md
Created March 11, 2018 05:38 — forked from belst/rocketguide.md
Deploy Rocket in production

Deploy Rocket using Letsencrypt and nginx

Information

This guide uses the domain your-domain.tld and its www. prefixed version. It starts the rocket application on 127.0.0.1:1337 and as the user www-data. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.

Prerequisites

You need to have nginx, certbot and rust installed.

@karuna
karuna / FieldArraysForm.js
Created February 1, 2018 08:28 — forked from erikras/FieldArraysForm.js
Example showing how to use a formValueSelector on an individual array item
/**
The following can replace the file in the Field Arrays example
(https://github.com/erikras/redux-form/tree/master/examples/fieldArrays) to demonstrate this functionality.
**/
import React from 'react'
import { connect } from 'react-redux'
import { Field, FieldArray, reduxForm, formValueSelector } from 'redux-form'
import validate from './validate'
@karuna
karuna / gist:eaf5540f0014e1f184cf2921bed5b45b
Created June 21, 2017 08:34 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
rds-modify-db-parameter-group {param-group-name} \
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=query_cache_type, value=1, method=pending-reboot" \
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \
require "net/http"
require "uri"
proxy_addr = "localhost"
proxy_port = 3128
uri = URI.parse "http://www.ugtop.com/spill.shtml"
Net::HTTP.new(uri.host, uri.port, proxy_addr, proxy_port).start do |http|
request = Net::HTTP::Get.new(uri.request_uri)
diff --git a/PKGBUILD b/PKGBUILD
index 6dab413..b0e384d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,13 +17,13 @@ conflicts=(
backup=('etc/php/conf.d/redis.ini')
source=(
- http://pecl.php.net/get/redis-${pkgver}.tgz
+ https://github.com/phpredis/phpredis/archive/php7.zip

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
require 'fileutils'
class MigrateUsersToPaperclip < ActiveRecord::Migration
def up
# Rename the old "mugshot" column to "old_file_name", since User.mugshot will now try to do Paperclip stuff
rename_column :users, :mugshot, :old_file_name
# Rename asset directories to pluralize
File.rename("public/system/user","public/system/users")
@karuna
karuna / Custom.css
Created March 12, 2012 02:38 — forked from bentruyman/Custom.css
Tomorrow Theme for Chrome Developer Tools
/**********************************************/
/*
/* Tomorrow Skin by Ben Truyman - 2011
/*
/* Based on Chris Kempson's Tomorrow Theme:
/* https://github.com/ChrisKempson/Tomorrow-Theme
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*