Skip to content

Instantly share code, notes, and snippets.

View n0mer's full-sized avatar
:bowtie:
working

Nik Handyman n0mer

:bowtie:
working
View GitHub Profile
@jfhbrook
jfhbrook / README.md
Created December 21, 2011 09:50
A hacked-together node.js alarm clock

BASICALLY I FORGOT TO FINISH DRYING MY SHEETS

so I'm sleeping on the couch

and I need an alarm clock

and my regular alarm clock is in the other room.

So, I wrote one.

@clstokes
clstokes / tomcat7
Created September 25, 2012 21:06
Enable JMX in Tomcat 7 on Ubuntu
#
# Since I have to look this up every time...
#
# Add the following in /etc/default/tomcat7
#
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote"
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=9991"
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@willurd
willurd / web-servers.md
Last active May 30, 2024 02:54
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@markSci5
markSci5 / Git checkout remote branch
Created July 3, 2013 07:08
Git checkout remote branch
//To fetch a branch, you simply need to:
git fetch origin
//This will fetch all of the remote branches for you. With the remote branches
//in hand, you now need to check out the branch you are interested in, giving
//you a local working copy:
git checkout -b test origin/test
@larrybotha
larrybotha / readme.markdown
Last active October 27, 2021 04:28
Postfix Using Gmail SMTP in Mac OSX Mavericks
@kohsuke
kohsuke / git-children-of
Created November 21, 2013 21:44
Given a commit, find immediate children of that commit.
#!/bin/bash -e
# given a commit, find immediate children of that commit.
for arg in "$@"; do
for commit in $(git rev-parse $arg^0); do
for child in $(git log --format='%H %P' --all | grep -F " $commit" | cut -f1 -d' '); do
git describe $child
done
done
done
@kolorobot
kolorobot / build.gradle
Created September 3, 2015 22:05
Spring Boot with overridden Spring Version (without dependency management)
buildscript {
ext {
springBootVersion = '1.2.5.RELEASE'
springVersion = '4.2.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
@bblanchon
bblanchon / GitExecutableFlag.sh
Last active August 8, 2023 13:53
Git: add executable flag to *.sh
find . -name '*.sh' | xargs git update-index --chmod=+x
package com.firebase.utils;
public class FireBasePushIdGenerator {
static final String PUSH_CHARS = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
static long LAST_PUSH_TIME = 0;
static int[] LAST_RANDOM_CHAR_IDXS= new int[12];
static char[] ID = new char[20];
public static String getFirebaseId() {
long now = System.currentTimeMillis();