Skip to content

Instantly share code, notes, and snippets.

@jnskender
jnskender / export-to-instance.js
Created February 2, 2022 12:56
Export to Instance
var exampleGR = new GlideRecord("<table>"); //works on any table
exampleGR.get('<sys_id');
var data = {};
var fields = exampleGR.getFields();
for (var i = 0; i < fields.size(); i++) {
var glideElement = fields.get(i);
if (glideElement.hasValue()) {
@jnskender
jnskender / game.rb
Created February 28, 2017 05:24
Snippet of Tic Tac Toe game.
@board = ['(1)', '(2)', '(3)', '(4)', '(5)', '(6)', '(7)', '(8)', '(9)']
def is_winner?
row_one = @board[0..2]
row_two = @board[3..5]
row_three = @board[6..8]
column_one = @board[0], @board[3], @board[6]
column_two = @board[1], @board[4], @board[7]
column_three = @board[2], @board[5], @board[8]
package budgetplanner;
/**
*
* @author Nick
*/
public class Budget
{
private float monthlyIncome;
private float otherIncome;
@jnskender
jnskender / Array Unbound Queue
Created September 29, 2014 23:29
Male And Female Lists with Queues
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gendernamelist;
/**
*
package paycheck;
/**
*
* @author Nick
*/
public class PayCalculations {
public double hours;
public double overtimeHours;
public double wagesEarned;
package unit.converter;
import java.util.Scanner;
/**
*
* @author Nick
*/
public class UnitConverter {
/**
* @param args the command line arguments