Skip to content

Instantly share code, notes, and snippets.

View rohshall's full-sized avatar

Salil Wadnerkar rohshall

  • United States
View GitHub Profile
/* TinyWM is written by Nick Welch <[email protected]>, 2005.
* TinyWM-XCB is rewritten by Ping-Hsun Chen <[email protected]>, 2010
*
* This software is in the public domain
* and is provided AS IS, with NO WARRANTY. */
#include <xcb/xcb.h>
int main (int argc, char **argv)
{
@hron84
hron84 / netbeans.desktop
Created May 10, 2011 06:10
Netbeans Linux shortcut
[Desktop Entry]
Encoding=UTF-8
Name=NetBeans IDE 7.0
GenericName=NetBeans IDE
Comment=NetBeans IDE
Icon=/opt/netbeans/nb/netbeans.png
Exec=/opt/netbeans/bin/netbeans
Category=Development;IDE;Java;
Type=Application
Terminal=false
@lfborjas
lfborjas / graph.java
Created August 1, 2012 04:31
A simple adjacency list implementation in OOP and not-so-OOP
/**I actually needed a typed language to make this clear, but fret not, there's a ruby example below!*/
public class Graph{
static class Vertex{
/** Every vertex is aware of its immediate adjacent neighbors*/
private List<Vertex> adjacent_vertices;
public void add_adjacent(Vertex neighbor){
adjacent_vertices.append(neighbor);
}
}
@fujimura
fujimura / api.hs
Last active December 16, 2015 05:59
Hit an web API with http-streams and aeson
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import Data.Aeson (FromJSON, parseJSON, (.:))
import qualified Data.Aeson as AE
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Lazy as LBS
import Network.Http.Client (Response, concatHandler, get)
import OpenSSL (withOpenSSL)
@qbit
qbit / gist:5483415
Last active February 25, 2024 13:35
KSH support for git-prompt
# ksh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@arttuladhar
arttuladhar / Convert.java
Created June 28, 2013 20:37
Converts resultSet to HashMap of Strings and Objects
/**
* <h2> Converts ResultSet to HashMap of List<String,Object></h2>
* @param row
* @param rs_SubItemType
* @throws SQLException
*/
private static void getHashMap( List<Map<String, Object>> row, ResultSet rs_SubItemType) throws SQLException {
ResultSetMetaData metaData = rs_SubItemType.getMetaData();
@akottr
akottr / Maven.sublime-build
Last active August 1, 2022 06:47
For maven build put this file into ~/.config/sublime-text-3/Packages/User. Choose Tools -> Build System -> Maven. Ctrl+Shift+ P shows the entries (e.g mvn clean)
{
"working_dir": "$file_path",
"shell_cmd":"mvn clean install",
"variants": [
{
"name": "mvn clean install",
"shell_cmd": "mvn clean install"
},
{
"name": "mvn full build",
@alghanmi
alghanmi / curl_example.cpp
Created May 5, 2014 20:12
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
Go to onedrive.com and sign-in with your Microsoft account. While you are logged in, drag a PDF file from the desktop onto the OneDrive website to upload it.
After the PDF file is uploaded, double-click to open the PDF file in the Word online app. Remember you are looking at the PDF file and it is not editable yet.
Click the Edit in Word button to open the PDF file for editing. Say yes when OneDrive asks for your permissions to convert the PDF into Word format (it makes a copy so your original PDF is unaltered).
Once the file is converted to PDF, click the Edit button to open the converted document in the Word app for editing.
Since you now editing the PDF as a standard Word document, you can edit it to your heart’s content. You can add images, change the logo, modify the text or apply different formatting, add tables and more. Once you are done, go to the File menu and choose Save As to download it as a PDF file again.
@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active April 14, 2025 15:08
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3