Skip to content

Instantly share code, notes, and snippets.

Avatar

Fizer Khan (பைசர் கான்) fizerkhan

View GitHub Profile
View Timeline.html
<!DOCTYPE html>
<html>
<head>
<title>Timeline</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
</head>
<body>
<p>This is a basic example of creating your own Timeline for viewing in the Web Inspector Timeline view.</p>
<p>Save the string logged to the console in a JSON file. Then load into the Timeline.</p>
</body>
View AwaitingReply.gs
function label_awaiting_reply() {
var emailAddress = Session.getEffectiveUser().getEmail();
Logger.log(emailAddress);
var EMAIL_REGEX = /[a-zA-Z0-9\._\-]+@[a-zA-Z0-9\.\-]+\.[a-z\.A-Z]+/g;
var label = GmailApp.createLabel("AwaitingReply");
var d = new Date();
d.setDate(d.getDate() - 7);
var dateString = d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate();
threads = GmailApp.search("in:Sent after:" + dateString);
for (var i = 0; i < threads.length; i++)
@AshKyd
AshKyd / rfc2822.js
Last active Apr 27, 2022
A momentjs RFC2822 formatted date string.
View rfc2822.js
var DATE_RFC2822 = "ddd, DD MMM YYYY HH:mm:ss ZZ";
moment().format(DATE_RFC2822);
@idosela
idosela / http-response-interceptor.js
Last active Nov 3, 2021
Sample code for ng-conf 2014
View http-response-interceptor.js
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
@hemanth
hemanth / devtool.bash
Created Nov 23, 2013
Hacking Chrome DevTools Setup
View devtool.bash
#!/usr/bin/env bash
# Setup script for hacking chrome devtools
# Source -> https://medium.com/p/8c8896f5cef3
echo "Creating folder and initialize a git repo"
mkdir devtools-frontend && cd devtools-frontend
git init
echo "Adding chromium remote and initialize sparse checkout"
git remote add upstream https://chromium.googlesource.com/chromium/blink
@ryanray
ryanray / deploy.rb
Created Nov 21, 2013
I couldn't find a quick example of how to deploy a node.js app using Capistrano 3. This gist assumes you are using Capistrano 3, Upstart, Forever, ssh/forward agent, and an unprivileged user named 'deploy'. Hopefully this simple setup will help to get you started.
View deploy.rb
# config/deploy.rb
# probably a lot of ways to improve this...
set :application, 'my_app'
set :repo_url, 'git@github.com:USERNAME/my_app.git'
# should set up a deploy user
set :user, 'deploy'
set :deploy_to, '/var/www/my_app'
set :scm, :git
@danriti
danriti / hipchat-v2.sh
Last active Jul 19, 2021
HipChat API v2 - Send a message to a room using cURL
View hipchat-v2.sh
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
@tinabeans
tinabeans / template.html
Last active Jun 29, 2022
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
View template.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@chrisckchang
chrisckchang / mongoose-options.js
Last active Aug 13, 2019
mongoose connection options
View mongoose-options.js
/* Mongoose 3.8.x configuration settings
*
* As discussed in: www.blogpost.com
*/
var mongoose = require('mongoose');
var uriUtil = require('mongodb-uri');
/*
* Mongoose by default sets the auto_reconnect option to true.
View angular.js
// Because people can't seem to find the gist description, here is the source
// of this code, a post found in last weeks JS Weekly, it is not my code
// http://www.angularails.com/articles/creating_simple_directive_in_angular
angular.module('ui-multi-gravatar', [])
.directive('multiAvatar', ['md5', function (md5) {
return {
restrict: 'E',
link:function(scope, element, attrs) {