Skip to content

Instantly share code, notes, and snippets.

View devgeeks's full-sized avatar

tommy-carlos williams devgeeks

View GitHub Profile
@andersdn
andersdn / index.html
Created August 22, 2012 06:46
Checkboxes created to look and behave like Android's new Holo UI. Pseudo checkbox created using data roles, with a "border triangle" added as required,
<div class="holoform dark">
<span class="checkbox">
<label for="check1">This is the label</label>
<span>
<input type="checkbox" name="check1" id="check1">
<label data-on="ON" data-off="OFF"></label>
</span>
</span>
<span class="checkbox">
<label for="check2">This one is already checked</label>
@ChrisMBarr
ChrisMBarr / isTouchDevice.js
Created November 18, 2012 21:06
Detect Touch Support
function isTouchDevice(){
try{
document.createEvent("TouchEvent");
return true;
}catch(e){
return false;
}
}
@dpogue
dpogue / Cambie.md
Last active December 15, 2015 04:29
First-pass documentation for the API design of Cambie.

Cambie

A unified native UI plugin for Apache Cordova.

The target platforms for Cambie are:

  • iOS 5.x+
  • Android 4.x+

It is a goal to also target these platforms wherever possible:

mochaAppium:
options:
usePromises: true
# Mocha options
reporter: 'spec'
timeout: 30e3
slow: 10e3
iphone:
src: ['www/spec/functional/sanity.js']
@madrobby
madrobby / gist:8dc43c58114466d6a894
Created June 24, 2014 12:20
Code to prevent drag/drop in a Webview inside a Mac app. You can throw this in a `<script>` tag first thing inside the `<body>`. Users will no longer be able to accidentally break your app by dropping something (like a web page URL) onto it.
document.addEventListener('dragover', function(e){
e.preventDefault();
e.stopPropagation();
}, false);
document.addEventListener('drop', function(e){
e.preventDefault();
e.stopPropagation();
}, false)
@tkafka
tkafka / LICENSE.txt
Last active May 17, 2024 02:08
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
function makeImageZoomable(panImg) {
if (typeof panImg == 'string')
panImg = document.getElementById(panImg);
var panImgContainer = panImg.parentNode;
var startScale;
var currentScale = 1;
var startX = 0;
var startY = 0;
var currentX = 0;
@mrfabbri
mrfabbri / app.js
Created February 4, 2015 23:19
App wide shortcuts in NW.js in "userland" [PoC]
"use strict";
var gui = require("nw.gui");
var AppShortcut = require("./appshortcut")(gui).AppShortcut;
var keycode = require('keycode');
var win = gui.Window.get();
if (process.platform === "darwin") {
var nativeMenuBar = new gui.Menu({type: "menubar"});
@MadeByMike
MadeByMike / bling.js
Last active July 23, 2021 12:32 — forked from paulirish/bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function (name, delegate, fn) {
var f
var target = this, match = false
var matches = this.matchesSelector || this.mozMatchesSelector || this.webkitMatchesSelector || this.oMatchesSelector || (function (name) {
$(name).forEach(function (elm) {
if (elm === target){
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {