Skip to content

Instantly share code, notes, and snippets.

#cVim-link-container, .cVim-link-hint, #cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results, .cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left, .cVim-completion-item .cVim-right, #cVim-hud, #cVim-status-bar {
font-family: Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial;
font-size: 10pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-link-container {
position: absolute;
pointer-events: none;
width: 100%; left: 0;
@f1code
f1code / nc.js
Created February 9, 2016 20:33
A simple netcat type tool for Windows (or anything really since it's written in javascript but no reason to use it on Linux)
var http = require('http');
var stdin = process.openStdin();
const PORT = 8080;
function handleRequest(request, response) {
console.log('Incoming request...');
body = '';
request.on('data', function(chunk) {
body += chunk;
});
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using SSSWorld.Common;
using System.IO;
@f1code
f1code / gallery.css
Last active January 24, 2016 21:44
Responsive thumbnail gallery using the Wordpress API
@f1code
f1code / simple_lightbox.js
Created November 30, 2015 11:46
Super simple lightbox... I feel like I have implemented this 10 times recently... This is more a base than a ready-to-use script.
function closeLightbox() {
$('.pledge_dialog_overlay').remove();
}
function centerDialog(content) {
var height = content.height();
var winHeight = $(window).height();
var spacing = Math.max(0, (winHeight - height) / 2);
var top = $(window).scrollTop() + spacing;
// in case there is a header bar... try to find where the content starts
@f1code
f1code / create-vhost.py
Created November 24, 2015 15:50
Create new virtualhost in WAMP
import sys, os, errno
from subprocess import call
HOSTS_FILE = "C:\\Windows\\System32\\drivers\\etc\hosts"
VHOSTS_FILE = "C:\\wamp\\bin\\apache\\apache2.4.9\\conf\\extra\\httpd-vhosts.conf"
WAMP_ROOT = "C:\\wamp\\www"
APACHE_SERVICE_NAME = "wampapache64"
def add_host_name(hostname):
text = "127.0.0.1 %(hostname)s %(hostname)s.local\n" % \
@f1code
f1code / salts.php
Created November 23, 2015 13:58
Script for generating WP secret keys (like https://api.wordpress.org/secret-key/1.1/salt/, but suitable to use in .env file)
<?php
function generate_salt($length) {
$seed = 'abcdefghijklmnopqrstuvwxyz'
.'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
.'0123456789!@#$%^&*()"'; // and any other characters
$rand = substr(str_shuffle(str_repeat($seed, $length)), 0, $length);
return $rand;
}
@f1code
f1code / library.php
Created November 14, 2015 15:44
Super simple, ugly and insecure PHP script for sharing files
<form enctype="multipart/form-data" method="POST">
<input type="file" name="upload"/>
<input type="submit" value="Submit"/>
</form>
<?php
$uploads_dir = "uploads/";
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(move_uploaded_file($_FILES['upload']['tmp_name'], $uploads_dir . basename($_FILES['upload']['name']))){
@f1code
f1code / QuickSearch.ascx
Created November 10, 2015 15:53
InforCRM Quick Search - For InforCRM 8.2
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="QuickSearch.ascx.cs" Inherits="SmartParts_Contact_QuickSearch" %>
<%@ Register Assembly="Sage.SalesLogix.Web.Controls" Namespace="Sage.SalesLogix.Web.Controls.PickList" TagPrefix="SalesLogix" %>
<%@ Register Assembly="Sage.SalesLogix.Web.Controls" Namespace="Sage.SalesLogix.Web.Controls" TagPrefix="SalesLogix" %>
<%@ Register Assembly="Sage.SalesLogix.Web.Controls" Namespace="Sage.SalesLogix.Web.Controls.Lookup" TagPrefix="SalesLogix" %>
<%@ Register Assembly="Sage.SalesLogix.HighLevelTypes" Namespace="Sage.SalesLogix.HighLevelTypes" TagPrefix="SalesLogix" %>
<style type="text/css">
.date input {
width: 7em;
}
@f1code
f1code / CustomInforColorScheme.css
Last active November 6, 2015 15:10
Customize color scheme for InforCRM
/* Custom style scheme for InforCRM */
/* Using #EB6800 as primary color */
/* Using #E37221 as link color */
.dijitTab,
.dijitTab .dijitTabInnerDiv,
.dijitTabListWrapper,
#MainHeader,
#titlePane,