Skip to content

Instantly share code, notes, and snippets.

View spjutbjorn's full-sized avatar

Christoffer Nordvall spjutbjorn

  • The Stellar Collective
  • Sweden
View GitHub Profile
git config --global credential.helper cache
@spjutbjorn
spjutbjorn / nodedebug.vscode
Created September 21, 2018 23:17
Debugging create react app in chrome
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}/src",
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
@spjutbjorn
spjutbjorn / LinuxOnWindows
Created September 12, 2018 19:24
Running linux subsystem on windows 10
Command line
DISM.exe /Online /Enable-Feature /All /FeatureName:Microsoft-Windows-Subsystem-Linux /NoRestart
Power shell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# install Chrome repo settings, upd packages and install chromee
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# git
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
CREATE PROCEDURE GetAllTableSizes
AS
/*
Obtains spaced used data for ALL user tables in the database
*/
DECLARE @TableName VARCHAR(100) --For storing values in the cursor
--Cursor to get the name of all user tables from the sysobjects listing
DECLARE tableCursor CURSOR
FOR
@spjutbjorn
spjutbjorn / fan.ino
Created April 14, 2017 10:54
arduino 25khz pwm drive
word VentPin = 3;
void setup() {
pinMode(VentPin, OUTPUT);
pwm25kHzBegin();
}
void loop() {
pwmDuty(19); // 25% (range = 0-79 = 1.25-100%)
delay(5000);
// request permission on page load
document.addEventListener('DOMContentLoaded', function () {
if (Notification.permission !== "granted")
Notification.requestPermission();
});
function notifyMe() {
if (!Notification) {
alert('Desktop notifications not available in your browser. Try Chromium.');
return;