Skip to content

Instantly share code, notes, and snippets.

View codenamejason's full-sized avatar
:octocat:
Buidling 🫠

<jaxcoder /> codenamejason

:octocat:
Buidling 🫠
View GitHub Profile
@codenamejason
codenamejason / Anon.js
Created March 29, 2018 17:18
Anonymous Function
(function ($){
return {
property: 'myProperty',
method: function(){
return someShit;
},
property: 'myProperty2',
method: function(){
return someShit2;
}
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using LoginScreen;
@codenamejason
codenamejason / Connection.cs
Created March 14, 2018 18:13 — forked from lancscoder/Connection.cs
Dapper Getting Started
public class ConnectionFactory {
public static DbConnection GetOpenConnection() {
var connection = new SqlConnection("MyConnectionString");
connection.Open();
return connection;
}
}
DECLARE ARRAY S;
function INIT(words)
S ← CREATE-ARRAY(LENGTH(words))
for k ← from 0 to LENGTH(words) do
S[k] ← EMPTY-ORDERED-SET
function EARLEY-PARSE(words, grammar)
INIT(words)
ADD-TO-SET((γ → •S, 0), S[0])
// index.js
const path = require('path')
const express = require('express')
const exphbs = require('express-handlebars')
const port = 8080
const app = express()
app.engine('.hbs', exphbs({
defaultLayout: 'main',
var objToday = new Date(),
weekday = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'),
dayOfWeek = weekday[objToday.getDay()],
domEnder = function() { var a = objToday; if (/1/.test(parseInt((a + "").charAt(0)))) return "th"; a = parseInt((a + "").charAt(1)); return 1 == a ? "st" : 2 == a ? "nd" : 3 == a ? "rd" : "th" }(),
dayOfMonth = today + ( objToday.getDate() < 10) ? '0' + objToday.getDate() + domEnder : objToday.getDate() + domEnder,
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'),
curMonth = months[objToday.getMonth()],
curYear = objToday.getFullYear(),
curHour = objToday.getHours() > 12 ? objToday.getHours() - 12 : (objToday.getHours() < 10 ? "0" + objToday.getHours() : objToday.getHours()),
curMinute = objToday.getMinutes() < 10 ? "0" + objToday.getMinutes() : objToday.getMinutes(),
use <DatabaseName>
go
SELECT
t.type AS [Type],
t.type_desc AS TypeDesc,
t.name AS Table_Name,
SCHEMA_NAME(schema_id) AS [Schema_Name],
c.name AS Column_Name
CREATE FUNCTION [dbo].[RemoveSpecialCharacters](@Temp VarChar(2000))
RETURNS VARCHAR(2000)
AS
BEGIN
DECLARE @KeepValues AS VARCHAR(50)
SET @KeepValues = '%[^A-Za-z0-9]%'
WHILE PatIndex(@KeepValues, @Temp) > 0
SET @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '')
Create Function [dbo].[RemoveNonNumericCharacters](@Temp VarChar(1000))
Returns BigInt
AS
Begin
Declare @Return BigInt
Declare @KeepValues as varchar(50)
Set @KeepValues = '%[^0-9]%'
While PatIndex(@KeepValues, @Temp) > 0
Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '')
CREATE FUNCTION [dbo].[RemoveNonAlphaCharacters](@Temp VarChar(2000))
RETURNS VARCHAR(2000)
AS
BEGIN
DECLARE @KeepValues AS VARCHAR(50)
SET @KeepValues = '%[^a-z]%'
WHILE PatIndex(@KeepValues, @Temp) > 0
SET @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '')