Skip to content

Instantly share code, notes, and snippets.

View selurvedu's full-sized avatar
🐧
In GNU we trust

selurvedu

🐧
In GNU we trust
View GitHub Profile
@myano
myano / cs.py
Created June 30, 2011 01:25
Quick example of ncurses in Python!
#!/usr/bin/env python
import curses
import curses.textpad
import time
stdscr = curses.initscr()
#curses.noecho()
#curses.echo()
@dupuy
dupuy / README.rst
Last active May 5, 2024 18:42
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@4ndrej
4ndrej / SSLPoke.java
Last active January 3, 2024 09:50
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
@pixelhandler
pixelhandler / pre-push.sh
Last active May 17, 2024 12:12
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@datagrok
datagrok / vendoring.md
Last active November 3, 2023 17:37
"Vendoring" is a vile anti-pattern

"Vendoring" is a vile anti-pattern

What is "vendoring"?

From a comment on StackOverflow:

Vendoring is the moving of all 3rd party items such as plugins, gems and even rails into the /vendor directory. This is one method for ensuring that all files are deployed to the production server the same as the dev environment.

The activity described above, on its own, is fine. It merely describes the deployment location for various resources in an application.

@macedd
macedd / yaffey-qt5.patch
Created June 11, 2014 23:38
Yaffey Patch for QT5 Compilation (ubuntu 12, 13, 14)
diff -rupN yaffey-orig/main.cpp yaffey-qt5/main.cpp
--- yaffey-orig/main.cpp 2014-06-11 20:01:50.155769286 -0300
+++ yaffey-qt5/main.cpp 2014-06-11 20:24:07.659482714 -0300
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
-#include <QtGui/QApplication>
+#include <QApplication>
anonymous
anonymous / tmux.conf
Created September 9, 2014 18:35
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
@schneiderfelipe
schneiderfelipe / cs.py
Last active December 4, 2017 20:26 — forked from myano/cs.py
#!/usr/bin/env python
import curses
import curses.textpad
def main_exec(stdscr):
begin_x = 20
begin_y = 7
height = 5
#if 0
pkg = glib-2.0 gio-2.0
src = $(MAKEFILE_LIST)
app = $(basename $(src))
CFLAGS = $(shell pkg-config --cflags $(pkg)) -x c
LDFLAGS = $(shell pkg-config --libs $(pkg))
$(app): $(src)
@doujiang24
doujiang24 / gist:fd5c7a46831a3df02f57
Created November 23, 2015 03:49
Lua get hostname
local ffi = require "ffi"
local C = ffi.C
ffi.cdef[[
int gethostname(char *name, size_t len);
]]
local size = 50
local buf = ffi.new("unsigned char[?]", size)