Skip to content

Instantly share code, notes, and snippets.

View arjunu's full-sized avatar
:shipit:

Arjun Umesha arjunu

:shipit:
View GitHub Profile
@shawnbot
shawnbot / index.md
Last active August 23, 2023 10:18
Testing web pages with Xcode's iOS Simulator

Finding the Simulator

You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":

screen shot 2013-05-06 at 12 04 27 pm

Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):

screen shot 2013-05-06 at 12 05 45 pm

@zephjc
zephjc / CharacterMotorC.cs
Created May 24, 2013 05:58
Fixed C# replacements of CharacterMotor.js and FPSInputController.js via http://forum.unity3d.com/threads/93527-FPSInputController-and-CharacterMotor-in-Csharp Changes from above link: FPSInputController: Removed "Event.laddertrigger" code which is not part of the original JS file CharacterMotor: Lets the various inner properties classes show up…
using UnityEngine;
using System.Collections;
//#pragma strict
//#pragma implicit
//#pragma downcast
// Require a character controller to be attached to the same game object
// I had to initally comment out the following RequireComponent
// line to make it compile and allow attaching to my Main Camera;
@iheanyi
iheanyi / NowArrayAdapter.java
Last active February 10, 2019 17:32
Google Now Cards Layout XML. list_item.xml can be customized to your heart's content . . . Also, you can implement the following with DragSortListView for swiping to delete, reordering, and whatnot.
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@othiym23
othiym23 / npm-upgrade-bleeding.sh
Created September 20, 2014 19:36
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@gregkorossy
gregkorossy / VisionApiFocusFix.java
Last active November 22, 2019 11:38
Mobile Vision API fix for missing autofocus feature
/*
* IF YOU WANT TO JUST ACCESS THE CAMERA INSTANCE SO THAT YOU CAN SET ANY OF THE PARAMETERS, VISIT THE FOLLOWING LINK:
* https://gist.github.com/Gericop/364dd12b105fdc28a0b6
*/
/**
* Custom annotation to allow only valid focus modes.
*/
@StringDef({
Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,
function isValidType( type, value ) {
function getType( item ) {
return Object.prototype.toString.call( item ).slice( 8, -1 );
}
function checkPrimitiveType( type, value ) {
return type == getType( value );
}
@frederickfogerty
frederickfogerty / server.js
Created November 17, 2015 21:52
HTML5 History API with webpack-dev-middleware
const _ = require('lodash')
const path = require('path')
const express = require('express')
const webpack = require('webpack')
const config = require('./webpack.dev.config')
const app = express()
const compiler = webpack(config)
var devMiddleware = require('webpack-dev-middleware')(compiler, {