Skip to content

Instantly share code, notes, and snippets.

Fredrik Leijon FredrikL

Block or report user

Report or block FredrikL

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am fredrikl on github.
  • I am fredrikl (https://keybase.io/fredrikl) on keybase.
  • I have a public key ASAZdxBPglqMJa6pt1E-vACefALiNIvssj9gT6pYez7WZwo

To claim this, I am signing this object:

@FredrikL
FredrikL / gist:7366915
Created Nov 8, 2013
Kill narrator & magnifier
View gist:7366915
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe]
"Debugger"="%1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\magnify.exe]
"Debugger"="%1"
View gist:7276972
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strips[8] = {
Adafruit_NeoPixel(72, 1, NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(72, 2, NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(72, 3, NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(72, 4, NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(72, 5, NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(72, 6, NEO_GRB + NEO_KHZ800),
Adafruit_NeoPixel(72, 7, NEO_GRB + NEO_KHZ800),
@FredrikL
FredrikL / gist:6580773
Last active Dec 23, 2015
Collision detection!?
View gist:6580773
for(var i= 0; i < entites.length; i++) {
if(py > (entites[i].y)) {
if(pw > entites[i].x &&
pw < (entites[i].x+10)){
player.x = entites[i].x -player.width;
} else if(player.x >= (entites[i].x+10) &&
player.x < (entites[i].x+20)) {
player.x = entites[i].x + 20;
}
View rails.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: rails
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start a Rails instance
# Description: Do the simplest thing possible in keeping with
# upstart to spin up a single Rails instance.
@FredrikL
FredrikL / buildall.ps1
Created Jun 21, 2012
Build everything
View buildall.ps1
foreach($sln in (Get-ChildItem . -recurse -include *.sln))
{
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild /m $sln
if ($LastExitCode -ne 0) { throw 'Build error' }
}
foreach($TestFile in (Get-ChildItem . -recurse -include *Test.csproj)) {
C:\Tools\NUnit-2.6.1\bin\nunit-console.exe /nologo /noshadow $TestFile
}
@FredrikL
FredrikL / make_token.rb
Created May 8, 2012 — forked from mirakui/make_token.rb
To get twitter/oauth access token
View make_token.rb
require 'twitter_oauth'
print 'Consumer Key> '
consumer_key = gets.chomp
print 'Consumer Secret> '
consumer_secret = gets.chomp
t = TwitterOAuth::Client.new(
:consumer_key => consumer_key,
View foo.cs
using System.Linq;
namespace Baz
{
public class Foo
{
public byte[] Bar()
{
byte[] b = new byte[] {};
View ball.ino
#include "LPD8806.h"
#include "SPI.h"
// code revision for my version of http://www.youtube.com/watch?v=IUhEINPraN8&feature=youtu.be
int aX = 0;
int aY = 1;
int aZ = 3;
int stripDataPin = 2;
View Wheels.cs
public class Wheels : IWheels
{
private readonly OutputPort motorOneDirection;
private readonly OutputPort motorTwoDirection;
private readonly PWM motorOneSpeed;
private readonly PWM motorTwoSpeed;
public Wheels(Cpu.Pin motorOneDirectionPin, Cpu.Pin motorOneSpeedPin,
Cpu.Pin motorTwoDirectionPin, Cpu.Pin motorTwoSpeedPin)
You can’t perform that action at this time.