Skip to content

Instantly share code, notes, and snippets.

View benstjohn's full-sized avatar
🏠
Working from home

Ben St. John benstjohn

🏠
Working from home
View GitHub Profile
@benstjohn
benstjohn / upscroll.js
Created February 28, 2016 04:58
Makes a nav bar appear when scrolling upward
var position = $(window).scrollTop(); // should start at 0
$(window).scroll(function() {
var scroll = $(window).scrollTop();
var el = document.getElementById('topbar');
var soc = document.getElementById('social');
var nav = document.getElementById('navlinks');
export function Accounts_beforeInsert(item_ob, context) {
if (item_ob.company_id === undefined) {
item_ob.company_id = item_ob.company.replace(/\s+/g, '-');
make_id_thing(item_ob.company_id, function (obj) {
item_ob.company_id = obj;
console.log("how about " + item_ob.company_id);
});
} else {
item_ob.company_id = item_ob.company_id.replace(/\s+/g, '-');
@benstjohn
benstjohn / ParentComponent.jsx
Created September 17, 2018 18:41
Problem with Notes
This is how I have it nested, this code is not stand alone
<NoteManager
accountID={this.props.match.params.id}
typeNotes="accounts"
/>
@benstjohn
benstjohn / FooterDate.wixCode
Created October 24, 2018 16:46
Wix Code Snippet for updating the year dynamically in the footer
//Make sure this goes on the SITE section of WIX CODE
$w.onReady(function(){
let date = new Date();
let year = date.getFullYear();
let footerString = "© "+ year + " Created by Kohler Expos, Inc." //you should be changing the last part
$w("#text161").text = footerString; //make sure to change text161 to match the appropriate reference
});
<?
require_once( dirname(__FILE__) . "/DB/config.php" );
//phpinfo(); exit;
function strFix($str)
{
$str = str_replace("\\'", "'", $str);
$str = str_replace("'''''", "'", $str);
@benstjohn
benstjohn / my-listings.js
Created January 21, 2019 19:28
Code for our MyListings Page
import wixData from "wix-data";
import { session } from "wix-storage";
$w.onReady(() => {
$w("#priceSlider").max = 5000000;
$w("#priceSlider").value = 250000;
$w("#yearMax").text = "2019";
$w("#priceMax").text = "$250,000";
$w("#squareFootage").text = "20,000";
loadRepeater();
if (session.getItem("homeSearch")) {
@benstjohn
benstjohn / jira-ticketing.js
Created December 15, 2020 17:17
This is for creating a React Native Jira Issue collector In-App! NOTE: You’ll need to import `import base64 from 'react-native-base64';
// This code sample uses the 'node-fetch' library:
// https://www.npmjs.com/package/node-fetch
const fetch = require("node-fetch");
const bodyData = `{
"update": {},
"fields": {
"summary": "Main order flow broken",
"parent": {
"key": "PROJ-123"