Skip to content

Instantly share code, notes, and snippets.

@jloescher
jloescher / wp-config.php
Last active August 29, 2015 14:04
Multi Environments | WP-Config.php
<?php
/** Absolute path to the WordPress directory. **/
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Define Environments **/
$environments = array(
'localhost' => 'localhost',
'development' => '',
@jloescher
jloescher / wp-config.environment.php
Created July 16, 2014 00:30
Multi Environments | WP-Config.environment.php
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@jloescher
jloescher / head.phtml
Last active April 16, 2020 02:38
Dynamically Create Schema.org code for head section of a Magento 1.9 website.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@jloescher
jloescher / gist:287e05352db0fd4722f1
Created November 8, 2015 04:51
aspnet-dockerfile
FROM debian:jessie
ENV DNX_VERSION 1.0.0-beta8
ENV DNX_USER_HOME /opt/dnx
RUN apt-get -qq update && apt-get -qqy install unzip curl libicu-dev libunwind8 gettext libssl-dev libcurl3-gnutls zlib1g && rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_USER_HOME=$DNX_USER_HOME DNX_BRANCH=v$DNX_VERSION sh
RUN bash -c "source $DNX_USER_HOME/dnvm/dnvm.sh \
&& dnvm install $DNX_VERSION -alias default -r coreclr \
@jloescher
jloescher / wordgames.py
Created August 26, 2016 19:13
Learning to program Part 2- Functions, Lists, and Strings
import random
def getRandomWord():
words = ["pizza", "cheese", "apples"]
word = words[random.randint(0, len(words)-1)]
return word
def showWord(word):
for character in word:
print(character, " ", end='')
package main
import "fmt"
func main() {
for i := 33; i <= 122; i++ {
fmt.Printf("%v in Hex is %#x and in Ascii is: %#U\n", i, i, i)
}
}
@jloescher
jloescher / ZSH-Config.md
Last active May 13, 2020 14:00
ZSH Configuration info.

How I choose where to put a setting

  • if it is needed by a command run non-interactively: .zshenv
  • if it should be updated on each new shell: .zshenv
  • if it runs a command which may take some time to complete: .zprofile
  • if it is related to interactive usage: .zshrc
  • if it is a command to be run when the shell is fully setup: .zlogin
  • if it releases a resource acquired at login: .zlogout
@jloescher
jloescher / twitter.js
Created August 29, 2020 22:15
Twitter API Start
require('dotenv').config();
const Twitter = require('twitter');
let client = new Twitter({
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
bearer_token: process.env.TWITTER_BEARER_TOKEN,
});
let params = {
@jloescher
jloescher / temperature_conversion.js
Created February 5, 2021 22:58
Temperature unit conversion JS
// Holds the constant value of the kelvin tempature
const kelvin = 0;
// Convert kelvin to celsius
const celsius = kelvin - 273;
// Convert celsius to fahrenheit
let fahrenheit = celsius * (9/5) + 32;
// Rount the value from the quation to the nearest whole number.
fahrenheit = Math.floor(fahrenheit);
console.log(`The temperature is ${fahrenheit} degrees Fahrenheit.`);
// Convert celsius to newtons
@jloescher
jloescher / rock_paper_scissors.js
Created February 6, 2021 02:56
Simple CLI rock, paper, scissors game.
const userInput = 'Bomb'.toLowerCase();
function getComputerChoice() {
let randomInt = Math.floor(Math.random() * 3);
switch (randomInt) {
case 0:
return 'rock';
break;
case 1:
return 'paper';