Skip to content

Instantly share code, notes, and snippets.

View samiare's full-sized avatar

Samir Zahran samiare

View GitHub Profile
@samiare
samiare / xcode_comments.sh
Created December 16, 2020 20:49
Finds TODO and FIXME tags and displays them as warnings in the buildtime issue navigator.
TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
@samiare
samiare / README.md
Last active July 5, 2021 17:58
Misc HTML/CSS/JS things

A collection of little hacks and a reusable code snippets that I have collected over time.

@samiare
samiare / settings.js
Last active September 6, 2016 17:58
Controller.js Settings Example
Controller.search()
Controller.globalSettings.useAnalogAsDpad = "left";
window.addEventListener("gc.button.press", function(event) {
// Pressing the left analog stick in any of the 4 cardinal
// directions will fire this event as if it were the
// appropriate d-pad button, i.e. DPAD_UP, DPAD_LEFT, etc.
}, false);
@samiare
samiare / events.js
Last active September 6, 2016 17:59
Controller.js Event Example
window.addEventListener("gc.button.press", updateButton, false);
window.addEventListener("gc.button.release", updateButton, false);
window.addEventListener("gc.analog.change", updateAnalog, false);
function updateButton(event) {
var message = detail.pressed ? "pressed" : "not pressed";
console.log("%s: %s", detail.name, message);
}
function updateAnalog(event) {
@samiare
samiare / app.js
Last active September 6, 2016 18:00
Controller.js Quick Start JS
Controller.search();
window.addEventListener("gc.controller.found", function(event) {
var controller = event.detail.controller;
console.log("Controller found at index %s.", controller.index);
console.log("'%s' is ready!", controller.name);
}, false);
>> "Controller found at index 0."
>> "'Wireless Controller' is ready!"
@samiare
samiare / index.html
Last active September 1, 2016 22:16
Controller.js Quick Start HTML
<html>
<head></head>
<body>
<!-- your wonderful markup -->
<script src="js/Controller.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
@samiare
samiare / analogstickevents.js
Last active September 6, 2016 18:00
Controller.js Analog Stick Events Example
window.addEventListener("gc.analog.start", function(event) {
console.log(event.detail);
}, false);
>> AnalogStick {
>> controllerIndex: 0,
>> time: 4526.165,
>> name: "LEFT_ANALOG_STICK",
>> position: { x: 0, y: 0 },
>> angle: { degrees: NaN, radians: NaN }
@samiare
samiare / buttonevents.js
Last active September 6, 2016 18:00
Controller.js Button Events Examples
window.addEventListener("gc.button.press", function(event) {
console.log(event.detail);
}, false);
>> Button {
>> controllerIndex: 0,
>> time: 4526.165,
>> name: "DPAD_UP",
>> pressed: false,
>> value: 0
@samiare
samiare / .bash_profile
Created November 7, 2015 19:00 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@samiare
samiare / Remove .DS_Store demons
Last active May 25, 2016 14:03
Remove pesky .DS_Store files
In Terminal
===========
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
-or?-
git rm -r --cached .
git add .
git commit -m "fixed untracked files"