Skip to content

Instantly share code, notes, and snippets.

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

<jaxcoder /> codenamejason

:octocat:
Buidling 🫠
View GitHub Profile
@anantn
anantn / firebase_detect_data.js
Created December 18, 2012 00:54
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@taylorkj
taylorkj / gist:9012616
Last active March 27, 2021 14:16
How to use Dapper's new Table Valued Parameter (TVP) in C#
/*
I wasn't able to find a single example on how to actually use Dapper's new TVP, so I though I'd add one.
First of all, you will need to install the Dapper.TVP package from NuGet.
The main item to note is the need to create and populate a list of SqlDataRecords. This is then used to used as part of the
input parameter for Dapper's TableValueParameter.
The API is thus:
var cubeToMove : CubeMover;
function Start() {
cubeToMove = GameObject.Find("Mover").GetComponent(CubeMover);
}
function OnMouseDown () {
transform.localScale.y = 0.2;
cubeToMove.Move();
cubeToMove.speed -= 0.1;
@jeremyricketts
jeremyricketts / index.html
Last active August 29, 2015 14:16
Boilerplate for starting new web projects.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page Title</title>
<meta name="author" content="Jeremy Ricketts">
<meta name="description" content="Short description of this delightful website.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/css/style.css" rel="stylesheet" type="text/css">
</head>
var cubeToMove : CubeMover;
function Start() {
cubeToMove = GameObject.Find("Mover").GetComponent(CubeMover);
}
function OnMouseDown () {
transform.localScale.y = 0.2;
cubeToMove.Move();
cubeToMove.speed -= 0.1;
@codenamejason
codenamejason / background.css
Last active August 29, 2015 14:16
Change background image with button
#imgDiv {
width: 400px;
height: 400px;
background-image: url('http://placehold.it/400.png&text=New_Image/464545/e743c3');
}
@codenamejason
codenamejason / life.js
Created March 3, 2015 17:50
Life Motto
Person you = GetCurrentPerson();
//life motto
if (you.Mood == MoodState.Sad)
{
// stop being sad
you.Mood = MoodState.Awesome;
};
@codenamejason
codenamejason / animate.css
Created March 3, 2015 18:25
Animate with CSS
/*Setup WOW.js
1
Link to the CSS animation library
Link to Animate.css
(You can link to another CSS animation library by changing WOW.js settings)
<link rel="stylesheet" href="css/animate.css">
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
0.990455599104
0.990131006372
0.988156953132
0.986346333872
0.980186977796
0.979454414848
0.97899422699
0.978388958838
0.978292975683
0.978014174891