Skip to content

Instantly share code, notes, and snippets.

View umrashrf's full-sized avatar
🏠
Working from home

Umair Ashraf umrashrf

🏠
Working from home
View GitHub Profile
@umrashrf
umrashrf / YouTubeUploadPlugin.java
Created March 26, 2012 07:31
Android YouTube Uploader
package org.apache.cordova;
import org.acra.ErrorReporter;
import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult;
import org.apache.cordova.api.PluginResult.Status;
import org.json.JSONArray;
import org.json.JSONException;
public class YouTubeUploadPlugin extends Plugin {
@umrashrf
umrashrf / YouTubeUploader-ios.js
Created March 26, 2012 07:56
iOS YouTube Uploader
(function() {
if (Cordova.hasResource("youtubeUploader")) return;
Cordova.addResource("youtubeUploader");
function YouTubeUploader() {
}
YouTubeUploader.prototype.uploadVideo = function(file, success, fail) {
YouTubeUploader ytu = new YouTubeUploader();
ytu.OtherLogin();
String url = ytu.UploadVideo(file, title, desc);
if (url != null) {
// it's URL of the uploaded video
} else {
// video failed to be uploaded
@umrashrf
umrashrf / gist:2471373
Created April 23, 2012 14:45
Integrating Sencha Touch 2.0 application with PhoneGap/Cordova
function loadApp() {
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'SenchaFiddle',
launch: function() {
Ext.create('Ext.Panel', {
GNU nano 2.2.4 File: /etc/nginx/sites-enabled/gitlab
# GITLAB
# Maintainer: @randx
# App Version: 4.0
upstream gitlab {
server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket;
}
@umrashrf
umrashrf / Job
Created March 15, 2013 05:40
I am trying to write XPath that will select <h3>, <ul> and <p> tags under div[@Class="content"] but with p[position() > 1 and position() < last() - 1] So far I have this.... //div[@Class="content"]/*[self::h3 or self::ul or self::p[position() > 1 and position() < last() - 1]]//text() But it doesn't work
<div class="content">
<h1></h1>
<h2>
<p>Certified Nursing Assistant - Full Time</p>
Job Summary</h2>
<p>Responsible for providing personal care and assistance for residents in long term care facility.</p>
<h2>
</h2><h3>Essential Functions:</h3>
@umrashrf
umrashrf / gist:5461291
Created April 25, 2013 16:57
iulms attendance page html
<table class="attendance-table">
<tbody><tr class="attendance-table-head">
<th class="table-head-td-course">Course</th>
<th class="table-head-td">Total Classes</th>
<th class="table-head-td">Present</th>
<th class="table-head-td">Absent</th>
<th class="table-head-td">Details</th>
</tr>
<tr class="attendanceRow">
@umrashrf
umrashrf / paginator.py
Created June 15, 2013 15:43
Django Paginator override for smart page_range or digg-style pagination.
from django.core.paginator import Paginator, Page
class SmartPaginator(Paginator):
def __init__(self, object_list, per_page, range_count=3,
orphans=0, allow_empty_first_page=True):
self.range_count = range_count
super(SmartPaginator, self).__init__(object_list, per_page, orphans=orphans,
allow_empty_first_page=allow_empty_first_page)
def page(self, number):
<?xml version='1.0' encoding='utf-8' ?>
<PAGE id='HRS_APP_SCHJOB'><GENSCRIPT id='script'><![CDATA[document.win0.HRS_LOCATION$hnewpers$0.value='0|0|0|1|1|0|0#2|0|0|0|0|0|0#';
document.win0.HRS_JOB_FAM_I$hnewpers$0.value='0|0|0|0|0|0|0#2|0|0|0|0|0|0#';
document.win0.HRS_LOC_VW1_$hnewpers$0.value='0|0|0|0|0|0|0#2|0|0|0|0|0|0#';
document.win0.HRS_JOB_FAM_I_2_$hnewpers$0.value='0|0|0|0|0|0|0#2|0|0|0|0|0|0#';
document.win0.HRS_AGNT_RSLT_I$hnewpers$0.value='0|0|0|0|0|69|0#1|0|0|0|0|97|0#2|0|0|0|0|0|0#5|0|0|0|0|198|0#6|0|0|0|0|46|0#10|0|0|0|0|96|0#';
gridList_win0 = [
['HRS_LOCATION$0',0,1,0,0,1],['HRS_JOB_FAM_I$0',0,1,0,0,1],['HRS_LOC_VW1_$0',0,1,0,0,1],['HRS_JOB_FAM_I_2_$0',0,1,0,0,1],['HRS_AGNT_RSLT_I$0',10,19,0,0,1]
];
gridHeaderList_win0 = [
@font-face {
font-family: Pictos;
src: url('http://cdn.sencha.io/touch/sencha-touch-2.3.0/resources/themes/fonts/pictos/pictos-web.eot');
src: url('http://cdn.sencha.io/touch/sencha-touch-2.3.0/resources/themes/fonts/pictos/pictos-web.eot?') format('☺'),
url('http://cdn.sencha.io/touch/sencha-touch-2.3.0/resources/themes/fonts/pictos/pictos-web.woff') format('woff'),
url('http://cdn.sencha.io/touch/sencha-touch-2.3.0/resources/themes/fonts/pictos/pictos-web.ttf') format('truetype'),
url('http://cdn.sencha.io/touch/sencha-touch-2.3.0/resources/themes/fonts/pictos/pictos-web.svg') format('svg');
font-weight: normal;
font-style: normal;
}