Skip to content

Instantly share code, notes, and snippets.

View redknitin's full-sized avatar
💭
Picking a coding challenge every week, while actively on a job-search.

Nitin redknitin

💭
Picking a coding challenge every week, while actively on a job-search.
View GitHub Profile
@redknitin
redknitin / movies.xml
Created October 5, 2015 06:11
XSLT test
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="movies.xsl"?>
<movies>
<movie name="Pirates of the Caribbean" />
<movie name="Lord of the Rings" />
</movies>
@redknitin
redknitin / ux-tools.txt
Created October 5, 2015 06:20
UX Tools List
crazyegg.com
Screaming Frog
Piwik
Optimizely
MixPanel
Flurry Analytics / Yahoo Analytics
Clicky
Mint
Church Analytics
KISSmetrics
@redknitin
redknitin / 12c-cmds.txt
Created October 5, 2015 06:32
Oracle 12c commands
Oracle 12c commands
To open pluggable databases:
ALTER PLUGGABLE DATABASE ALL OPEN;
(sometimes the pluggable database says that it is in an initializing state and requires this to be run from the container database)
To get the port for the enterprise manager (usually the port is 5500 and the URL us http://localhost:5500/em ):
select dbms_xdb_config.gethttpsport() from dual;
@redknitin
redknitin / php-ldap-try.php
Created October 5, 2015 06:39
LDAP in PHP
<?php
require_once 'Net/LDAP2.php';
$cfg = array(
'binddn'=>'pokemon\nitin', //'cn=nitin,ou=users,dc=pokemon,dc=local',
'bindpw'=>'gorillacheese',
'basedn'=>'dc=pokemon,dc=local',
'host'=>'pokemon.local'
);
@redknitin
redknitin / InstanceThing.cs
Created November 16, 2015 09:11
Dynamically load DLL in .NET
//This is in LibFunctions.dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibFunctions
{
public class InstanceThing
@redknitin
redknitin / NotifyTask.cs
Created November 16, 2015 13:43
.NET: Publish to RabbitMQ
ConnectionFactory connFac = new ConnectionFactory();
connFac.Uri = "amqp://user:pass@172.16.5.17:5672";
connFac.UserName = "user";
connFac.Password = "pass";
IConnection conn = connFac.CreateConnection();
IModel channel = conn.CreateModel();
channel.ExchangeDeclare("TaskNotify", ExchangeType.Direct);
channel.QueueDeclare("NewTask", false, false, true, null);
channel.QueueBind("NewTask", "TaskNotify", "Glowfish", null);
@redknitin
redknitin / kombutest.py
Created November 29, 2015 13:08
Kombu Producer and Consumer
from kombu.mixins import ConsumerMixin
from kombu import Exchange, Connection, Queue
from kombu import Producer
import json
import pymysql
class P:
def __init__(self, conn):
self.connection = conn
@redknitin
redknitin / fetch.swift
Created February 19, 2016 20:48
Get data from URL - HTTP GET - Really simple!
import UIKit
var url = NSURL(string: "https://en.wikipedia.org/wiki/Swift_(programming_language)")
var dataBinary = NSData.init(contentsOfURL: url!)
var dataStr = NSString.init(data: dataBinary!, encoding: NSUTF8StringEncoding)
print(dataStr)
@redknitin
redknitin / fetch_nsurlsession.swift
Created February 19, 2016 21:33
Using NSURLSession for HTTP requests
func funkytown() {
let request = NSMutableURLRequest(URL: NSURL(string: "http://www.cnn.com")!)
//request.HTTPMethod = "POST"
//let postString = "id=13&name=Jack"
//request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)
request.HTTPMethod = "GET"
let task = NSURLSession.sharedSession().dataTaskWithRequest(request) { data, response, error in
guard error == nil && data != nil else { // check for fundamental networking error
@redknitin
redknitin / cascadingddl.html
Created November 1, 2017 12:39
Cascading dropdowns in HTML-JS with static data
<!--
Name: Cascading Dropdowns for Static Data
Description: Provide a dictionary object using JSON and the pair of dropdowns to link together
Author: Nitin
-->
<!doctype html><html><head>
<script>
function ddlpopulate(ddl, arr) {
ddl.options.length = 0;