Skip to content

Instantly share code, notes, and snippets.

View abdollahpour's full-sized avatar
😎
Let's microservice the world!

Hamed Abdollahpour abdollahpour

😎
Let's microservice the world!
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Boostrap Number</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
.input-group{ text-align: center; padding: 5px; }
</style>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
@lucsmall
lucsmall / init.lua
Created September 28, 2015 07:02
Using Nodemcu to drive a 74HC595 shift register
latch_pin = 2
gpio.mode(latch_pin, gpio.OUTPUT)
gpio.write(latch_pin, gpio.LOW)
result = spi.setup(1, spi.MASTER, spi.CPOL_HIGH, spi.CPHA_LOW, spi.DATABITS_8, 0)
print(result)
while true do
for i=1,255,1 do
print(i)
@jjfiv
jjfiv / JSONUtil.java
Created February 27, 2015 21:41
JSON escaping and unescaping that really works, no dependencies.
// BSD License (http://lemurproject.org/galago-license)
package org.lemurproject.galago.utility.json;
public class JSONUtil {
public static String escape(String input) {
StringBuilder output = new StringBuilder();
for(int i=0; i<input.length(); i++) {
char ch = input.charAt(i);
int chx = (int) ch;
@StephanHoyer
StephanHoyer / gist:bddccd9e159828867d2a
Last active March 29, 2022 11:46
Isomorphic applications with mithril

Attention

This post described how to create an application with mithril 0.2.x. Now that ver 1.0 is out, some things are a little differnent.

The example is updated with the current version of mithril, though.

Isomorphic applications with mithril

@cilf
cilf / wildfly-install.sh
Last active May 26, 2022 19:11 — forked from sukharevd/wildfly-install.sh
Install Wildfly 8.2.0.Final @ CentOS 7
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 8.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Marek Polcar, Dmitriy Sukharev
#date :20140601
#usage :/bin/bash wildfly-install.sh
WILDFLY_VERSION=8.2.0.Final
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION
@simonewebdesign
simonewebdesign / install_sublime_text.sh
Last active March 11, 2024 12:23
Install Sublime Text 3 on Linux via POSIX shell script - http://simonewebdesign.it/install-sublime-text-3-on-linux/
#!/bin/sh
# Sublime Text 3 Install (last update: Monday 13 March 2017)
#
# No need to download this script, just run it on your terminal:
#
# curl -L git.io/sublimetext | sh
# Detect the architecture
@jdcrensh
jdcrensh / Base62.java
Last active January 28, 2024 12:25
Class to encode a string into base 62 (character set [a-zA-Z0-9]) with Java. A common use case is URL shortening.
public class Base62 {
public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public static final int BASE = ALPHABET.length();
private Base62() {}
public static String fromBase10(int i) {
StringBuilder sb = new StringBuilder("");
@jsfeng
jsfeng / FileServlet.java
Created May 7, 2012 19:31
FileServlet supporting resume, caching and GZIP
/*
* net/balusc/webapp/FileServlet.java
*
* Copyright (C) 2009 BalusC
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without