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.
$ python -m SimpleHTTPServer 8000
# nokogiri requires open-uri | |
require 'nokogiri' | |
require 'open-uri' | |
# csv will be used to export data | |
require 'csv' | |
require 'mechanize' | |
# pp is useful to display mechanize objects | |
require 'pp' | |
#!/bin/sh | |
#takes one argument/parameter: the name of the package which didn't install correctly and should be removed along with its dependencies | |
#do opkg update first | |
#example: ./opkgremovepartlyinstalledpackage.sh pulseaudio-daemon | |
#get list of all packages that would be installed along with package x | |
opkg update | |
PACKAGES=`opkg --force-space --noaction install $1 | grep http | cut -f 2 -d ' ' | sed 's/.$//'` | |
for i in $PACKAGES | |
do |
require 'excon' | |
require 'pp' | |
require 'yajl' | |
# Auth parameters | |
username = 'root' | |
password = 'secret' | |
host = '192.168.1.1' | |
# Will parse returned JSON content | |
parser = Yajl::Parser.new |
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.
$ python -m SimpleHTTPServer 8000
Last Update: May 13, 2019
Offline Version
A Modified function of Paul Irish's StaticServer shell function, according to this gist You can run static servers for many languages.
$ staticServer <lang> <port> #port is optional, default is 8000
Data Down / Actions Up
Plain JSBin's
Ember Version Base JSBin's
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
# Load importer part of fiddle (ffi) library | |
require 'fiddle/import' | |
# Create module as body for an importer instance | |
module MessageBox | |
# Extend this module to an importer | |
extend Fiddle::Importer | |
# Load 'user32' dynamic library into this importer | |
dlload 'user32' | |
# Set C aliases to this importer for further understanding of function signatures |
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$ | |
DECLARE | |
id bigint; | |
BEGIN | |
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN | |
id = NEW.id; | |
ELSE | |
id = OLD.id; | |
END IF; | |
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text); |