Skip to content

Instantly share code, notes, and snippets.

View charlwillia6's full-sized avatar
🐢
Becoming Awesome

Charles Williams charlwillia6

🐢
Becoming Awesome
View GitHub Profile
@tbjgolden
tbjgolden / inotify-instructions.md
Last active April 6, 2024 07:13
[Arch Linux] [Manjaro] How to avoid "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)

To avoid this error, we need to increase the inotify watcher limit.

The way to do this is different on Arch based distributions than other Linux distributions.

Instructions for Arch Linux/Manjaro

Check for an already existing inotify config file (recent versions of Manjaro include one)

@ThYpHo0n
ThYpHo0n / .zshrc
Last active April 11, 2024 19:00
WSL(2) bash profile helpers
# WSL?
if [[ "$(< /proc/sys/kernel/osrelease)" == *microsoft* ]]; then
export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g')
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0
# pip path if using --user
export PATH=$PATH:$HOME/.local/bin
# SSH
@charlwillia6
charlwillia6 / .gitignore
Last active September 23, 2019 18:26 — forked from andreasonny83/.gitignore
Gitignore template for JavaScript projects
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/build
# Runtime data
pids
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@iamggreen
iamggreen / TemplateHtmlHelper.cs
Created January 11, 2014 08:41
Extension method to render ASP.NET MVC partial view to a string
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using System.Collections.Concurrent;
using System.Text;
namespace PartialViewTemplatesSample
@sniffdk
sniffdk / ContextHelpers.cs
Last active February 28, 2022 10:03
Fake an UmbracoContext for use when doing published scheduling or other scenarios where UmbracoContext is normally null.
public class ContextHelpers
{
public static UmbracoContext EnsureUmbracoContext() {
if (UmbracoContext.Current != null)
{
return UmbracoContext.Current;
}
var httpContext = new HttpContextWrapper(HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("temp.aspx", "", new StringWriter())));
@odenijs
odenijs / Render partial view as string
Created August 13, 2013 13:10
Render a partial view as a string
/// <summary>
/// Renders the partial view to string.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="partialViewName">Partial name of the view.</param>
/// <param name="viewData">The view data.</param>
/// <param name="tempData">The temp data.</param>
/// <returns></returns>
public static string RenderPartialViewToString(ControllerContext context, string partialViewName, ViewDataDictionary viewData, TempDataDictionary tempData)
{