Skip to content

Instantly share code, notes, and snippets.

View PoisonousJohn's full-sized avatar

Ivan Fateev PoisonousJohn

View GitHub Profile
@PoisonousJohn
PoisonousJohn / Example.cs
Created March 21, 2017 07:29 — forked from JohannesEH/Example.cs
How to make a non-nullable type wrapper in C#, today… (doesn't work, for blog)
public void DoStuff(object input)
{
if (input == null)
throw new ArgumentNullException("input");
// Method implementation...
}
@PoisonousJohn
PoisonousJohn / nodejs.sh
Created February 18, 2017 19:06 — forked from ted-piotrowski/nodejs.sh
Install latest NodeJS on Ubuntu ARM
sudo apt-get uninstall nodejs # uninstall nodejs 4.2.6
wget https://nodejs.org/dist/v6.6.0/node-v6.6.0-linux-armv7l.tar.gz # get latest ARM build
tar -xvf node-v6.6.0-linux-armv7l.tar.gz # extract it
sudo cp node-v6.6.0-linux-armv7l /etc/node6.6 # copy extracted file to /etc folder
sudo ln -s /etc/node6.6/bin/node /usr/bin/node # link the nodejs executable
sudo ln -s /etc/node6.6/bin/npm /usr/bin/npm # link the npm executable
node --version # should output v6.6.0
@PoisonousJohn
PoisonousJohn / visualstudiocode.sh
Created February 18, 2017 14:22 — forked from ted-piotrowski/visualstudiocode.sh
Visual Studio Code on ARM Debian Linux
# building Visual Studio Code Debian package on ARM
# get source code
git clone git@github.com:Microsoft/vscode.git
cd vscode
# build debian package
./scripts/npm.sh install --arch=armhf
./node_modules/.bin/gulp vscode-linux-arm-build-deb
@PoisonousJohn
PoisonousJohn / AssetGPULoader.cs
Created January 14, 2016 10:42 — forked from flarb/AssetGPULoader.cs
Unity3d GPU Pre-loader
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
public class AssetGPULoader : MonoBehaviour {
public Camera activeCamera;
RenderTexture _rt;
#!/bin/bash -x
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
# Extension Copyright (c) 2013 FoundryLogic LLC
# http://foundrylogic.com
#
# Extended by Ronan O Ciosoig January 2012
export NDK=/tmp/android-ndk-r8b
# Create the standalone toolchain
$NDK/build/tools/make-standalone-toolchain.sh \
--platform=android-9 \
--install-dir=/tmp/my-android-toolchain
export PATH=/tmp/my-android-toolchain/bin:$PATH
export SYSROOT=/tmp/my-android-toolchain/sysroot
export CC="arm-linux-androideabi-gcc --sysroot $SYSROOT"
varying lowp vec4 DestinationColor; // 1
void main(void) { // 2
gl_FragColor = DestinationColor; // 3
}
/**
* source : http://snipplr.com/view/22741/slugify-a-string-in-php/
*
* @static
* @param $text
* @return mixed|string
*/
static public function slugify($text)
{
// replace non letter or digits by -
<?php
namespace WSL\BaseBundle\Util\Helper;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Acl\Permission\MaskBuilder;
/*
* To change this template, choose Tools | Templates