Skip to content

Instantly share code, notes, and snippets.


Tamim Bin Ibrahim tamimibrahim

View GitHub Profile
View convert-mp3-frm-webm.txt
ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3"
Skalman / index.php
Created Apr 20, 2015
Dynamic RSS feeds from Youtube links
View index.php
if (!isset($_GET['url'])) {
<!DOCTYPE html>
<meta charset="utf-8">
<title>Youtube RSS creator</title>
<p>Create an RSS feed for the videos on the following page:
<p><input name="url" placeholder="E.g." style="width: 30em">
rupl / picturefill-test.js
Last active Jul 4, 2017
A CasperJS script to test the canonical Picturefill demo. This sample accompanies a blog post series about CasperJS found at
View picturefill-test.js
* @file
* Testing to see if Picturefill selects the right source at multiple
* viewport sizes.
// Define the suite of tests and give it the following properties:
// - Title, which shows up before any of the pass/fails.
// - Number of tests, must be changed as you add tests.
// - suite(), which contains all of your tests.
View album_description.rb
require 'watir-webdriver'
puts "== Album Description Updater =="
description =[0])
parts = description.scan(/https:\/\/www\.facebook\.com\/.*?\/media_set\S+/)
puts "There are #{parts.length} albums whose descriptions are to be updated!"
browser = :firefox, :profile => 'watir'
scottjehl /
Last active Jan 27, 2022
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with:

For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

akiyoshi83 / scrape.js
Created May 15, 2014
CasperJS scraping sample
View scrape.js
var system = require('system');
var fs = require('fs');
var args = system.args;
// args is phantomjs api.
// args [3] and later arguments of casperjs
var _args = args.slice(3);
if(_args.length < 2) {
console.log("USAGE: casperjs scrape.js URL");
# Define Variables + Casper Initialization
fakeReferer = ''
targetUrl = ''
casper = require('casper').create()
# Fake the referer
casper.start fakeReferer, ->
View Makefile
casperjs index.js && convert *.jpg video.mpeg && gify video.mpeg out.gif && rm *.jpg video.mpeg
View index.js
var fs = require('fs');
var parse = require('url').parse;
var uid = require('uid2');
var express = require('express');
var phantomjs = require('phantom');
var app = express();
View screenshots.js
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
* Usage:
* $ casperjs screenshots.js
var casper = require("casper").create();