Skip to content

Instantly share code, notes, and snippets.

@TheZoc
TheZoc / sublime_text_setup.bat
Last active January 26, 2023 18:08
Sublime Text right click context menu and PATH variable setup (Windows)
@ECHO off
REM ===========================================================================
REM Sublime Text - Path and Right Click context menu
REM Felipe Guedes - https://github.com/TheZoc
REM https://gist.github.com/TheZoc/e3295df094801fa937596964499ac048
REM ---------------------------------------------------------------------------
REM I've swapped my environment so many times recently, that I decided to write
REM this overengineered solution to add Sublime Text 3 to the right click menu
REM on Windows, and to add it to the current user PATH environment variable
REM allowing `subl.exe` to be easily usable from command line.
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active February 27, 2024 14:08
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
import Foundation
extension Dictionary {
mutating public func setValue(val: AnyObject, forKeyPath keyPath: String) {
var keys = keyPath.componentsSeparatedByString(".")
guard let first = keys.first as? Key else { print("Unable to use string as key on type: \(Key.self)"); return }
keys.removeAtIndex(0)
if keys.isEmpty, let settable = val as? Value {
self[first] = settable
} else {
@soarez
soarez / ca.md
Last active April 22, 2024 03:01
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@simonrjones
simonrjones / gist:8783515
Created February 3, 2014 13:09
Sub-modules in Zend Framework. See blog post at http://simonrjones.net/2010/06/sub-modules-in-zend-framework/
<?php
/**
* Studio 24 Application
*
* @category Studio 24
* @package S24_Application
* @copyright Copyright (c) 2009-2010 Studio 24 Ltd (www.studio24.net)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @author Simon R Jones <simon@studio24.net>
* @version 1.1
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active February 19, 2024 21:55
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@nicolasramy
nicolasramy / wordpress.local
Created July 30, 2012 12:43
Simple Apache2 Virtual Host for WordPress
<VirtualHost *:80>
ServerAdmin nicolas.ramy@hostname.com
ServerName wordpress.local
# Indexes + Directory Root.
DirectoryIndex index.php index.html
DocumentRoot /var/www/workspace/wordpress/
# BEGIN WordPress
<IfModule mod_rewrite.c>
@creationix
creationix / chatServer.js
Created November 19, 2010 20:47
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client