Skip to content

Instantly share code, notes, and snippets.

View SIRHAMY's full-sized avatar
🐷
Loading...

Hamilton Greene SIRHAMY

🐷
Loading...
View GitHub Profile
@SIRHAMY
SIRHAMY / create_vertex.json
Created July 25, 2016 21:51
Showing how to use LIST properties in IBM's GraphDB
{ "label": "post",
"properties":
{
"title":"Use LIST properties on IBM GraphDB",
"text": "This is how you do it"
}
}
@SIRHAMY
SIRHAMY / app.js
Created July 26, 2016 19:51
Example app.js to run react-router on a Node and Express web server
// This application uses express as its web server
// for more info, see: http://expressjs.com
var express = require('express');
const path = require('path')
// create a new express server
var app = express();
// serve the files out of ./public as our main files
var insertGreeting = function(Reader) {
if(Reader.isNew()) {
return (
"Hi, my name's Hamilton. I'm entering my last " +
"semester at Georgia Tech where I'm majoring in " +
"Computer Science. For the past year, I've made " +
"it a habit to publish my accomplishments and " +
"aspirations at the end of each semester. I use " +
"it, primarily, to track my progress with respect " +
"to my short-term goals and long-term growth. " +
@SIRHAMY
SIRHAMY / gtltexample.html
Created September 18, 2016 04:49
React/JSX: Put greater than and less than symbol in HTML
<div>{"<"} Less than, {">"} greater than </div>
@SIRHAMY
SIRHAMY / JwtTokenCreator.cs
Created March 22, 2017 18:22
Example of how to use Microsoft's System.IdentityModel.Tokens.Jwt to create a JWT Token
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Linq
using System.Text;
using Microsoft.IdentityModel.Tokens;
public class JwtTokenCreator
{
private readonly JwtSecurityTokenHandler _jwtSecurityTokenHandler;
@SIRHAMY
SIRHAMY / RegExCounter.js
Created May 29, 2018 22:11
Count the number of occurrences of a Regex match on a given webpage.
var minNumberOfOccurrencesToPrint = 3; // Min number of occurrences you care about
var documentHtml = document.documentElement.outerHTML; // Grab HTML
var occurrences = (documentHtml.match(/YourRegexGoesHere/g) || []); // Search page for occurrences, use regexpal.com to test your regex
var wordCounter = {};
for (let match of occurrences) {
if(match in wordCounter) {
wordCounter[match] += 1;
} else {
wordCounter[match] = 1;
@SIRHAMY
SIRHAMY / CsvReader.linq
Created August 8, 2018 15:35
LinqPad (C#) CSV Parser
// readPath goes here
const string licenseCsvPath = @"C:\some\path";
// writePath goes here
const string writeSqlpath = @"C:\some\path";
var sqlString = new StringBuilder();
sqlString.Append(
@"INSERT INTO dbo.myTable