Skip to content

Instantly share code, notes, and snippets.

View icyflame's full-sized avatar

Siddharth Kannan icyflame

View GitHub Profile
@hernan
hernan / autocomplete.html
Created November 30, 2011 15:39
jquery autocomplete demo with custom render item implementation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Autocomplete - Custom data and display</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.6.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
@gabrielemariotti
gabrielemariotti / README.md
Last active March 9, 2023 06:02
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@zeroasterisk
zeroasterisk / confirm.sh
Created August 31, 2011 14:04
confirm.sh a simple way to add confirmation to bash scripts
# ======================================================================
#
# @link http://wuhrr.wordpress.com/2010/01/13/adding-confirmation-to-bash/#comment-3540
#
# Function: confirm
# Asks the user to confirm an action, If the user does not answer yes,
# then the script will immediately exit.
#
# Parameters:
# $@ - The confirmation message
@mikeygee
mikeygee / 01-before.html
Created May 7, 2012 07:45
truncate blog posts in jekyll
<!-- using the truncate filter -->
{% for post in site.posts limit:10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span>
{% if post.content.size > 2000 %}
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node -->
<a href="{{ post.url }}">read more</a>
{% else %}
{{ post.content }}
{% endif %}
@icyflame
icyflame / to_https.sh
Last active February 12, 2022 16:12 — forked from michaelsilver/fix_github_https_repo.sh
Convert all GitHub git remotes to SSH or HTTPS.
#/bin/bash
#-- Script to automatically convert all git remotes to HTTPS from SSH
# Script will change all the git remotes.
# If you didn't intend to do that, run the other script in this repo.
# Original 1: https://gist.github.com/m14t/3056747
# Original 2: https://gist.github.com/chuckbjones/9dc6634fe52e56ba45ac
# Thanks to @m14t, @michaelsilver and @chuckbjones.
ssh_to_https(){
REPO_URL=`git remote -v | grep -m1 "^$1" | sed -Ene's#.*(git@github.com:[^[:space:]]*).*#\1#p'`
@carols10cents
carols10cents / ruby-to-rust-cheat-sheet.md
Last active November 24, 2020 23:12
Ruby to Rust Cheat Sheet

Ruby to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in Ruby and Rust so that programmers most comfortable with Ruby can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

Ruby:

@tyru
tyru / camelcase.pl
Created April 7, 2010 09:45
camelize/decamelize in Perl without String::CamelCase.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Test::More;
sub camelize {
my ($s) = @_;
@icantrap
icantrap / git-proxy.sh
Created October 26, 2010 20:25
How to Github and Gitorious over HTTP proxy

You could always use Smart HTTP.

For read-only (git:) urls, install corkscrew.

  1. Download git-proxy.sh. Put it somewhere and make it executable.

  2. Run git config --global core.gitproxy '/usr/local/bin/git-proxy.sh'

To clone, push, pull over ssh, add the contents of ssh_config to your ~/.ssh/config file.

@icyflame
icyflame / alonso-quote.md
Last active April 11, 2018 07:46
Fernando Alonso's Interview to Martin Brundle, telecast on Sky F1 in the pre-race-build-up of the Chinese GP 2016.

No, no regrets. I never regret anything that I do. You learn with things, you grow up with things, and in the moment that I made all the choices and all the things, I thought in that moment that it was the right one. Once you are clear with yourself and happy with yourself in that moment, to see things later is a waste. Pointless, you know, there's nothing you can do. I am happy with everything.

--

Fernando Alonso

2016 Chinese Grand Prix

pre-race show on Sky F1

@icyflame
icyflame / http proxy list of files.md
Last active January 13, 2018 17:20
Because clearing the http proxy settings is more of a pain than finding the right settings to use in the first place
Location Variable names Command to check if this variable still exists
~/dotfiles/.local/kgp.zsh HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy `export
~/.gitconfig Git variables for http and https proxies git config --list
~/.bowerrc proxy and https-proxy used by Gulp No command, check the file itself. remove or change variable name in the file
~/.npmrc http-proxy and https-proxy used by NPM No command, check the file and remove or change
/etc/systemd/system/docker.service.d/http-proxy.conf Environment used by Docker to pull images systemctl show --property=Environment docker => Output should be Environment= (if it shows proxy, then this file needs to be changed) Tutorial