Skip to content

Instantly share code, notes, and snippets.

@yogeshmanghnani
yogeshmanghnani / CircularProgressBar.swift
Last active June 23, 2021 11:04
This is a Circular Progress Bar View. Demo application at :- http://github.com/yogeshmanghnani/circularProgressBar
//
// CircularProgressBar.swift
// attendance-manager
//
// Created by Yogesh Manghnani on 02/05/18.
// Copyright © 2018 Yogesh Manghnani. All rights reserved.
//
import UIKit
@MylesBorins
MylesBorins / low-pass-device.js
Created April 15, 2016 16:15
Low pass filter of device orientation
var tilt = {
alpha: 0,
beta: 0,
gamma: 0
};
function lowPass(prev, curr, co) {
return prev * co + curr * (1 - co);
}
@houoop
houoop / knock-paging-extend.js
Created January 9, 2013 10:20
knockout paging extend
ko.extenders.paging = function (target, pageSize) {
var _pageSize = ko.observable(pageSize || 10), // default pageSize to 10
_currentPage = ko.observable(1); // default current page to 1
target.pageSize = ko.computed({
read: _pageSize,
write: function (newValue) {
if (newValue > 0) {
_pageSize(newValue);
}
@vitalyrotari
vitalyrotari / touch.js
Last active July 15, 2025 10:39
jQuery Touch Gestures
jQuery Touch Gestures ported from QUOjs
@see http://quojs.tapquo.com/
Version 1.1
-- @add singleTap event
-- @fix doubleTap event
-- @fix hold event
@pixbit
pixbit / index.html
Created July 27, 2012 01:07
CSS brushed metal
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS brushed metal by Simurai &middot; CodePen</title>
<!--
Copyright (c) 2012 Hugo Giraudel, http://codepen.io/HugoGiraudel
Permission is hereby granted, free of charge, to any person obtaining
@evantahler
evantahler / example.js
Created June 1, 2012 12:31
PhoneGap / Cordova Device Token plugin JS component (iOs)
// An example of how to use the PhoneGap / Cordova plugin described in this post [[ http://blog.evantahler.com/phonegap-and-push-notifications ]] to get an iOs device token
document.addEventListener("deviceready", function(){
getDeviceToken();
}
getDeviceToken = function(){
if(typeof device != "undefined" && typeof cordova == "object"){
var getToken = function(types, success, fail){
cordova.exec(success, fail, "PushToken", "getToken", types);
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@hyle
hyle / ko.utils.signatures.js
Last active February 24, 2025 14:47
KnockoutJS utils (ko.utils) signatures
// knockout 2.2.1
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ }
@vorushin
vorushin / jquery-csrf.js
Created June 24, 2011 08:51
Small jQuery plugin for adding csrf-token to Ajax/Ajaj requests
$.ajaxSetup({
beforeSend: function(xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {