Skip to content

Instantly share code, notes, and snippets.

@irfaan
irfaan / NotificationViewController.swift
Created May 28, 2018 22:26 — forked from Hokila/NotificationViewController.swift
Put AVPlayerLayer on UserNotification, also add play pause button
/*
See LICENSE folder for this sample’s licensing information.
Abstract:
Contains ImageContentExtension's NotificationViewController.
*/
import UIKit
import UserNotifications
import UserNotificationsUI
pragma solidity ^0.4.11;
// @calvin_claus' contract
// @neuling2k didn't do anything
contract CryptoLambo {
address public dev1;
address public dev2;
@irfaan
irfaan / rubik.sol
Created February 13, 2018 22:33 — forked from lhartikk/rubik.sol
pragma solidity ^0.4.8;
contract Rubik {
enum Color {Red, Blue, Yellow, Green, White, Orange}
Color[9][6] state;
address public owner = msg.sender;
uint8 constant FRONT = 0;
// New Form
form.signup_form(method="post" action="/")
//- Keyword + Intro
.card
//- Card Content
.card_content
//- Card Section
.card_section
//- Personal Details
.grid
// New Form
form.signup_form(method="post" action="")
//- Keyword + Intro
.card
//- Card Content
.card_content
//- Card Section
.card_section
//- Phone Number
.grid
'use strict';
var CLIENT_ID = 'CLIENT ID';
var API_KEY = 'YOUR SECRET API KEY (Test or Live)';
var TOKEN_URI = 'https://connect.stripe.com/oauth/token';
var AUTHORIZE_URI = 'https://connect.stripe.com/oauth/authorize';
var qs = require('querystring');
var request = require('request');
@irfaan
irfaan / gist:87bbf12bfe66db840adc1cd6e849166f
Created May 10, 2016 15:07 — forked from peter/gist:9121297
Force SSL for Express app on Heroku
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Hooking up the middleware with the express app
// In app.js
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var forceSSL = require('../middleware/ssl').force(config.hostname);
if ('production' == app.get('env')) {
app.use(forceSSL);
}

Keybase proof

I hereby claim:

  • I am irfaan on github.
  • I am irfaan (https://keybase.io/irfaan) on keybase.
  • I have a public key whose fingerprint is A1D2 B1E6 50EE D023 856C F306 BF0A F020 A7F4 FD6C

To claim this, I am signing this object:

@irfaan
irfaan / readme.md
Created December 1, 2015 02:06 — forked from RaVbaker/readme.md
[HOWTO] Rewrite all urls to one index.php in Apache

Redirect All Requests To Index.php Using .htaccess

In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:

Simple Example

This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|