Skip to content

Instantly share code, notes, and snippets.

View lvnilesh's full-sized avatar
💭
🏆 Vibranium Status Level

LV Nilesh lvnilesh

💭
🏆 Vibranium Status Level
View GitHub Profile
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
@adamlogic
adamlogic / gist:1435139
Created December 5, 2011 20:07
Setup instructions for developer machine (Ruby)

My setup for Rails dev on OS X Lion

  1. Back up

    A few things to think about:

    • media
      • photos, music, and videos should all be on external drive
    • projects/code
  • make sure all Git repos are pushed up
@masnick
masnick / gist:1654182
Created January 21, 2012 21:52
Amazon S3 bucket policy for www.maxmasnick.com
{
"Version": "2008-10-17",
"Id": "b2cc31d0-cc91-4285-a658-473099d2c867",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@IanVaughan
IanVaughan / uninstall_gems.sh
Created June 9, 2012 20:37
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@wycks
wycks / htaccess cache and stuff
Last active March 26, 2022 20:48
Boilerplate .htaccess from Paul Irish with WordPress added
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# Ruby file to use the Google Prediction API, with a very hacked OAuth2
# You'll want to replace all the custom variables including..
# 1. Your google storage bucket name
# 2. Your google storage access credentials (note that gstore only works with "legacy" google storage access so you'll need to enabled this)
# 3. Your OAuth credentials which you setup from here https://code.google.com/apis/console/ by selecting "API Access"
# Note that I choose "Create client ID" and then "Installed Application".
#
# This script is intended to be run as a regular background process (like a cron job) to process data. It has no access to a browser and no web server to expose a callback url. Hence the hacking of OAuth2. This seems completely wrong to me but I haven't gotten any other authentication with the API to work. If anyone knows a better way please post a comment!
#
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

sudo apt-get install -y git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else