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
@lvnilesh
lvnilesh / .zshrc
Last active August 29, 2015 14:27 — forked from SlexAxton/.zshrc
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
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;
@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": "*"
},
# 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!
#

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

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@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
@lvnilesh
lvnilesh / x-theme-functions.php
Created September 15, 2016 03:20 — forked from woogist/x-theme-functions.php
The code below allow for Themeco - X Theme to be integrated with Sensei.
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme', 'sensei_support' );
function sensei_support() {
add_theme_support( 'sensei' );
}
/**
* Remove the default Sensei wrappers
@lvnilesh
lvnilesh / test-api-server.md
Last active August 23, 2019 03:49
Test the api server using cURL

Test against the deployment

GET all users

curl -i -X GET http://childrewards.herokuapp.com/users

GET second user

curl -i -X GET http://childrewards.herokuapp.com/users/518e921e90c0800200000002