Skip to content

Instantly share code, notes, and snippets.

@Elrashid
Elrashid / EndlessRecyclerOnScrollListener.java
Created November 1, 2015 07:55 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
using System;
using System.Collections.Generic;
using Windows.Security.Credentials;
namespace utilities
{
class PasswordVault_Utility
{
const int ElementNotFound = unchecked((int)0x80070490);
//private resource = "www.example.com";
//private userName = "userName";
using System;
using System.Threading.Tasks;
using Windows.Data.Json;
using Windows.Security.Authentication.Web;
using Windows.Web.Http;
namespace WabCS
{
class WebAuthenticationBroker_Facebook_Utility
{
@Elrashid
Elrashid / static_server.js
Created January 7, 2016 08:28 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@Elrashid
Elrashid / gulpfile.js
Created January 10, 2016 14:24
angular2 gulp watch browserSync
/// <binding AfterBuild='build' Clean='clean' />
"use strict";
var path = require('path');
var gulp = require('gulp');
var del = require('del');
var typescript = require('gulp-typescript');
var inlineNg2Template = require('gulp-inline-ng2-template');
var sourcemaps = require('gulp-sourcemaps');
@Elrashid
Elrashid / sync.js
Created January 26, 2016 02:47 — forked from swh/sync.js
Spreadsheet / Calendar syncing in Google Apps
/* Gobal settings */
var calId = "YOUR_CALENDAR_ID";
var alertEmail = 'YOUR_EMAIL_ADDRESS';
var sheetName = 'Holiday';
/*
* FIXME: handle rows being deleted from the spreadsheet - right now they will
* stay in the calendar if that happens
*/
//
// ViewController.swift
// DoReMi
//
// Created by Jason Schatz on 11/18/14.
// Copyright (c) 2014 Udacity. All rights reserved.
//
import UIKit
import Foundation
@Elrashid
Elrashid / gist:798075c6d773c4487fc904852c08f1de
Last active October 15, 2016 22:16
Automate adding #Twitter User Not Flowing Back to a List and unfollow them with C# and Tweetinvi
Auth.SetUserCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
var user = Tweetinvi.User.GetUserFromScreenName("osman_elrashid");
RateLimit.RateLimitTrackerMode = RateLimitTrackerMode.TrackAndAwait;
var lists = user.GetOwnedLists(Int32.MaxValue);
var followerIds = user.GetFollowerIds(Int32.MaxValue);
var friendIds = user.GetFriendIds(Int32.MaxValue);
var followersCount = followerIds.Count();
var friendsCount = friendIds.Count();
var followersFlowingBack = followerIds.Where(x => friendIds.Contains(x) ).Count();
sudo pcmanfm
//#http://linuxcommand.org/lc3_lts0020.php
pi@raspberrypi:~ $ cd Downloads
//#http://unix.stackexchange.com/questions/210185/download-file-from-internet-to-server-using-ssh
//#http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX
wget https://download3.ebz.epson.net/dsc/f/03/00/05/12/63/134fae46183afb544b9276c4e5477187635fc90c/epson-printer-utility_1.0.0-1lsb3.2_i386.deb
wget https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/03f073cf68f9ee0350a121671ff2a1ea13fb24ef/epson-inkjet-printer-201401w_1.0.0-1lsb3.2_i386.deb
//#http://tutorialforlinux.com/2016/02/07/how-to-install-epson-l220l222-printer-driver-software-utility-on-ubuntu-linux/
sudo apt-get install gdebi
DateTime date = DateTime.Now;
//01
DateTime dateutc01 = date.ToUniversalTime() ;
//or
//02
DateTime dateutc02 = TimeZoneInfo.ConvertTimeToUtc(date);
//or
//be careful you are getting a new Date tIme
//03
DateTime dateutc03 = DateTime.UtcNow