Skip to content

Instantly share code, notes, and snippets.

View AfzalivE's full-sized avatar

Afzal Najam AfzalivE

View GitHub Profile
@AfzalivE
AfzalivE / reminder12-04
Created March 23, 2012 11:40
Ubuntu 12.04 reminder This did not prevent a disaster.
To remove upon fresh install:
sudo aptitude remove aisleriot mahjongg gnome-sudoku gnomine shotwell remmina thunderbird gwibber vino rhythmbox ubuntuone-installer
To install upon fresh install:
sudo add-apt-repository ppa:tualatrix/ppa
sudo add-apt-repository ppa:cairo-dock-team/weekly
sudo add-apt-repository ppa:synapse-core/ppa
sudo aptitude install ubuntu-tweak myunity vlc gnome-panel synapse cairo-dock
compiz config settings manager
@AfzalivE
AfzalivE / Preferences.sublime-settings
Created June 12, 2013 02:27
sublime text 2 settings
{
"auto_complete_delay": 0,
"bold_folder_labels": true,
"caret_style": "phase",
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Base16 Tomorrow Night Aqua.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".gitkeep",
$testuser = new User;
$testuser->username = 'testuser';
$testuser->email = '[email protected]';
$testuser->password = 'test';
$testuser->first_name = 'Harry';
$testuser->last_name = 'Potter';
$testuser->confirmed = 1;
$testuser->save();
<?php
// Other methods go here
// Auth filter
Route::filter('auth', function()
{
if (\League\OAuth2\Server\Util\Request::buildFromGlobals()->header('Authorization')) {
// TODO DOES NOT WORK!!!
return Route::filter('oauth', 'LucaDegasperi\OAuth2Server\Filters\OAuthFilter');
} else {
@AfzalivE
AfzalivE / gist:e26d4b10efdd7239031e
Created May 23, 2014 04:51 — forked from anonymous/gist:11010752
Inspiration for openGL stuff
URL: http://beesandbombs.tumblr.com/page/6
void setup(){
size(500,500,P3D);
smooth(8);
}
float f(int i, int j, float q){
return(q*(noise(.2*(i+400-.05*frameCount),.2*(j+90))-.5));
}
public class MyService extends Service implements OnSharedPreferenceChangeListener {
private Looper mServiceLooper;
private ServiceHandler mServiceHandler;
@Override
public void onCreate() {
// Start up the thread running the service. Note that we create a
// separate thread because the service normally runs in the process's
static String createAuthHeader(String username, String password) {
return "Basic " + Base64.encodeToString((username + ":" + password).getBytes(), Base64.NO_WRAP);
}
@AfzalivE
AfzalivE / CircularArray.java
Last active August 29, 2015 14:20
CircularArray
package com.kiwiwearables.kiwilib;
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
@AfzalivE
AfzalivE / bintray.properties
Last active August 29, 2015 14:21
Bintray publishing
group = com.afzaln
baseName = fab
pkgName = FloatingActionButton
description = FloationActionButton implementation forked from Clans, has automatic quick return on scroll
siteUrl = https://github.com/afzalive/FloatingActionButton
issuesUrl = https://github.com/afzalive/FloatingActionButton/issues
gitUrl = https://github.com/afzalive/FloatingActionButton.git
@AfzalivE
AfzalivE / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console