Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
matthewmccullough / settings.xml
Created April 13, 2009 19:41
Maven settings.xml Mirror Setup for Nexus
<mirrors>
<mirror>
<!--This is used to direct the public snapshots repo in the profile below over to a different nexus group -->
<id>nexus-public-snapshots</id>
<mirrorOf>public-snapshots</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
</mirror>
<mirror>
<!--This sends everything else to /public -->
<id>nexus-public-releases</id>
@shahpoojan
shahpoojan / usb.cpp
Created July 6, 2011 12:57
A code to send data on the USB port for Windows
#include <iostream>
#include <string>
#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
#include <Winbase.h>
HANDLE hCom;
DWORD sendData (const char* data, DWORD size)
@ticean
ticean / SVN_Git_Mirror.md
Created January 3, 2012 21:14
SVN Git Mirror

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References

@MicahElliott
MicahElliott / demo.txt
Created January 13, 2012 22:10
Display all the possible toilet fonts for a string.
banner
### ###
# # # # # ###### ## #### #### # # ###
# # # # # # # # # # # # # ###
# # # #### ##### # # #### # # # #
# # # # # # ###### # # # #
# # # # # # # # # # # # # # ###
### ###### # # # ###### # # #### #### # # ###
package test.weldtest;
import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
public class App {
public static void main(String[] args) {
WeldContainer weld = new Weld().initialize();
weld.instance().select(HelloWorldWriter.class).get().sayIt();
}
@I3rixon
I3rixon / Main.java
Created July 29, 2013 00:46
pretty output of hexdump like in Java
public static void prettyOut(byte[] msg) {
for (int j = 1; j < msg.length+1; j++) {
if (j % 8 == 1 || j == 0) {
if( j != 0){
System.out.println();
}
System.out.format("0%d\t|\t", j / 8);
}
System.out.format("%02X", msg[j-1]);
if (j % 4 == 0) {
@samarpanda
samarpanda / Debugging_Nginx.md
Last active March 16, 2020 13:24
Debugging Nginx Configuration!

Debugging Nginx Configuration

  • Set Nginx log-level to debug

    server {  
      error_log /var/logs/nginx/samar.error.log  debug;  
    }  
    # Word of caution: Don't forget to revert debug-level for error_log on a *very* high traffic site.  
@fernando-basso
fernando-basso / proxy.bash
Last active April 25, 2023 06:43
Proxy functions. Place them in $HOME/.bashrc or in a differente file, and then source it from bashrc, or source it manually when needed. The file extension is merely illustrative.
#!/usr/bin/env bash
# gsettings list-recursively org.gnome.system.proxy
# Change de ip address and port number accordingly.
function myProxyOn() {
gsettings set org.gnome.system.proxy mode 'manual' # ' manual / nome / automatic '
gsettings set org.gnome.system.proxy.http host '10.0.0.1'
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.https host '10.0.0.1'
@LunaCodeGirl
LunaCodeGirl / examples.sh
Created September 25, 2013 23:39
Figlet how to and examples
figlet "I've got something to say"
figlet -f thick "Make Tech ASCIIer"
date | figlet -f basic
@franz-josef-kaiser
franz-josef-kaiser / ajax.js
Last active May 31, 2022 15:53
AJAX in WordPress. Class based example.
( function( $, plugin ) {
"use strict";
// Working with promises to bubble event later than core.
$.when( someObjectWithEvents ).done( function() {
console.log( 'AJAX request done.' );
} )
.then( function() {
setTimeout( function() {
console.log( 'AJAX requests resolved.' );