Skip to content

Instantly share code, notes, and snippets.

View Console output
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
~/D/P/c/puma (master) $ cd ~/Desktop/
~/Desktop $ ls
temp.js
~/Desktop $ node temp.js
8
~/Desktop $ gjslint temp.js
----- FILE : /home/kevin/Desktop/temp.js -----
Line 1, E:0002: Missing space after ","
@KevinJones
KevinJones / fix_chrome_icon.sh
Last active Aug 29, 2015
elementary OS Luna: Fix blurry Chrome dock icon
View fix_chrome_icon.sh
# If your dock icon for Chrome is blurry in elementary OS Luna, this well help you fix it.
# This will create symbolic links for each of the icon sizes in the /usr/share/icons/elementary/apps directory.
# Log out and log back in afterwards to see the changes.
function make_link {
if [ "$1" ]
then
SIZE=$1; sudo ln -s /opt/google/chrome/product_logo_$SIZE.png /usr/share/icons/elementary/apps/$SIZE/google-chrome.png
fi
}
@KevinJones
KevinJones / gist:11264481
Created Apr 24, 2014
Multiple Singletons Example
View gist:11264481
// Three parts:
// 1. an enum with N values (or N+1 if you include a "None")
// 2. N enumerated singleton instances implementing a common interface. These provide information associated with each enum value in one place.
// 3. a static class allowing callers to access each enumerated singleton instance by passing in the corresponding enum value, creating it if necessary.
// Part 1
public enum Biome
{
Desert = 1,
Snow = 1 << 1,
View MyCFunction.c
// a global function; no need to expose this in a header file
void internalDoSomething()
{
// put your function here.
}
// note that if you were using C++ or Objective-C++ you'd need to put this in an extern closure, like so:
extern "C"
{
@KevinJones
KevinJones / CartesianProductSelectManyExample.cs
Created Feb 13, 2014
C# SelectMany Example - Cartesian Product
View CartesianProductSelectManyExample.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class CartesianProductSelectManyExample
{
public static void Main(string[] args)
{
var abcArray = new string[]{"a", "b", "c"};
View gist:6952485
void Update()
{
// attach to camera
if (Input.GetMouseButtonDown(0)) {
var ray = camera.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit)) {
Vector3 v = hit.point;
// instantiate the "ping" transform at v