Skip to content

Instantly share code, notes, and snippets.

View jameskraus's full-sized avatar

James Kraus jameskraus

View GitHub Profile
@markddavidoff
markddavidoff / slack-pagerduty-oncall.py
Created February 27, 2019 05:24 — forked from devdazed/slack-pagerduty-oncall.py
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@jslatts
jslatts / ReactConfig.cs
Last active May 17, 2021 05:44
webpack config for React.NET with server side bundle
ReactSiteConfiguration.Configuration.AddScriptWithoutTransform("~/wwwroot/ng-server.bundle.js");
ReactSiteConfiguration.Configuration.JsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings
{
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
};
// Don't use slower IE engine
ReactSiteConfiguration.Configuration.AllowMsieEngine = false;
@mp4096
mp4096 / ppt2pdf.ps1
Created April 28, 2016 10:56
Batch convert PowerPoint files to PDF
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders
# The produced PDF files are stored in the invocation folder
#
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
# Thanks to MFT, takabanana, ComFreek
#
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system.
# You can allow them by calling PowerShell as an Administrator and typing
# ```
# Set-ExecutionPolicy Unrestricted

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@stalmok
stalmok / jpegtran-directory.sh
Last active December 11, 2015 04:39 — forked from rik/jpegtran-directory.sh
Bash: Optimize .jpg images
#!/usr/bin/env bash
function optimize
{
echo $1
filesize=`stat --format=%s "$1"`
if [[ $filesize -lt 10000 ]]; then
jpegtran -copy none -optimize "$1" > "$1.bak"
echo "pet"
else