Skip to content

Instantly share code, notes, and snippets.

View WarFox's full-sized avatar
🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️

Deepu Mohan Puthrote WarFox

🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
@tfoldi
tfoldi / tableau.rb
Created April 24, 2013 07:56
This ruby class can logon and invoke REST API URLs in Tableau server. Authentication is done by using RSA crpyto stuff.
require 'httpclient'
module TableauLDAPSync
class Tableau
def initialize(server_url)
proxy = ENV['HTTP_PROXY']
@http_client = HTTPClient.new(proxy)
@http_client.set_cookie_store("cookie.dat")
@pichfl
pichfl / better_image_tag.rb
Created January 2, 2012 01:03
Liquid Image Tag for Jekyll
# A simple plugin for Jekyll that allows you to use {% url "alt text" %} to add images to your posts.
# It will automatically check those images for width and height.
#
# Requires http://imagesize.rubyforge.org/
require 'image_size'
require 'open-uri'
module Jekyll
@maxim
maxim / .kitchen.yml
Last active February 21, 2018 21:32
A hack to easily launch and test multiple nodes with test kitchen 1.0
# We need each node defined as a separate platform in order to give them different ip addresses on the private network
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
box: opscode-ubuntu-12.04
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box
@simecek
simecek / facebook_mining.r
Created January 18, 2012 18:26
Facebook Mining
# go to 'https://developers.facebook.com/tools/explorer' to get your access token
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************"
require(RCurl)
require(rjson)
# Facebook json function copied from original (Romain Francois) post
facebook <- function( path = "me", access_token, options){
if( !missing(options) ){
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) )
@kinopyo
kinopyo / sinatra_render_html.rb
Created October 21, 2011 07:13
How to render static HTML files in Sinatra.
require 'sinatra'
get '/' do
File.read(File.join('public', 'index.html'))
# or
# send_file File.join(settings.public, 'index.html')
end
@christine-le
christine-le / HDFS-Hive-Presto Setups.md
Last active February 27, 2019 18:36
HDFS, Hive, and Presto Setups

Hadoop

Pre-Requisites:

  $ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
  $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  $ chmod 0600 ~/.ssh/authorized_keys

Edit two files:

@rougier
rougier / rounded-box.el
Last active October 3, 2020 13:24
SVG Rounded box for Emacs
(require 'svg)
;; Rounded boxes using SVG:
;; This could be made into a function but size of text needs to be computed
(defun tag (text &optional foreground background font-size)
(let* ((font-size (or font-size 12))
;; The char-width ratio depends on the font family
(char-width (* font-size 0.58))
(char-height (+ font-size 1))
@matthewmccullough
matthewmccullough / git-deletealltags.bsh
Created April 1, 2011 20:29
Script to delete all tags both locally and remotely
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
@mikroskeem
mikroskeem / gccemacs_osx.md
Last active July 11, 2023 14:59
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

@craig-jennings
craig-jennings / alacritty.yml
Last active October 7, 2023 02:36
Alacritty/NuShell/Starship Settings
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will