Skip to content

Instantly share code, notes, and snippets.

@pliablepixels
pliablepixels / NVIDIA GPU CUDA 10.1 Ubuntu 18.md
Last active August 23, 2023 10:28
All the stuff to get CUDA 10.1 working with NVIDIA GPUs on Ubuntu 18.04. My notes.

All the stuff to get CUDA 10.1 working with NVIDIA GPUs on Ubuntu 18.04. My notes.

Step 1: Install NVIDIA Driver

  • sudo apt install nvidia-driver-430
  • reboot
  • run nvidia-smi. If it does not show your GPU, stop, fix. If this doesn't work, nothing else will (the rest of the stuff will compile, but won't work)
@ProNotion
ProNotion / ISO3166-Country-List-Table.sq
Created January 21, 2016 12:01
TSQL ISO3166 Country List Table
PRINT 'Checking for existence of table ''countries'''
/****** Object: Table [dbo].[Countries] Script Date: 11/09/2006 16:58:01 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Countries]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Countries]
PRINT 'Existing table ''countries'' dropped!'
GO
/****** Object: Table [dbo].[Countries] Script Date: 11/09/2006 16:58:01 ******/
@biapar
biapar / InitArcheType
Last active October 18, 2015 11:03
How to read and write to Umbraco Archetype
var archetypeValueAsString = member.GetValue<string>("figli");
var member = Services.MemberService.GetById(user.Id);
if (archetypeValueAsString == null)
{
//var archetype2 = JsonConvert.DeserializeObject<ArchetypeModel>(archetypeValueAsString);
ArchetypeModel a = new ArchetypeModel();
@Jeavon
Jeavon / RteCustomValueConverter.cs
Created September 30, 2014 09:41
Remove invalid rel tags from RTE images on render
namespace Crumpled.Logic.ValueConverters
{
using System.Linq;
using System.Web;
using HtmlAgilityPack;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.ValueConverters;
@abjerner
abjerner / TwitterEntities.cs
Last active August 15, 2016 18:03
Formatting entities in a Twitter status message (tweet)
private string FormatStatusMessageText(TwitterStatusMessage tweet) {
// Normally we should be able to call tweet.Entities.GetAllReversed() but that method
// will throw an exception if the array of media entities is NULL (which it is if there
// are no media attached to the tweet).
List<TwitterBaseEntity> entities = new List<TwitterBaseEntity>();
entities.AddRange(tweet.Entities.HashTags);
entities.AddRange(tweet.Entities.Urls);
entities.AddRange(tweet.Entities.Mentions);
if (tweet.Entities.Media != null) entities.AddRange(tweet.Entities.Media);
@mattbrailsford
mattbrailsford / PublishedContentExtensions.cs
Last active August 29, 2015 13:57
A JQuery like API for Umbraco
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.WebPages;
using Umbraco.Core.Models;
using Umbraco.Web;
namespace Our.Umbraco.Api.Jq
{
public static class PublishedContentExtensions
anonymous
anonymous / MemberLogin.cshtml
Created December 19, 2012 11:47
A Umbraco 4.10+ SurfaceController based Login Form
@model UmbracoLogin.MemberLoginModel
@if (User.Identity.IsAuthenticated)
{
<p>Logged in: @User.Identity.Name</p>
<p>@Html.ActionLink("Log out", "MemberLogout", "MemberLoginSurface")</p>
}
else
{
using (Html.BeginUmbracoForm("MemberLogin", "MemberLoginSurface"))
{
@alexdunae
alexdunae / fb-gallery-embed.html
Created September 24, 2011 17:05
Embedded Facebook Page Photo Gallery with jQuery