Skip to content

Instantly share code, notes, and snippets.

@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@tsabat
tsabat / zsh.md
Last active July 7, 2024 16:56
Getting oh-my-zsh to work in Ubuntu
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@djangofan
djangofan / gist:3113588
Created July 14, 2012 21:50
Cron job script to give a disk space usage alert email
#!/bin/sh
# this script was initially written for Redhat/CentOS
# file is /etc/cron.daily/diskAlert.cron
# requires enabling outgoing sendmail from localhost to a valid
# smtp server, which is usually disabled by default
ADMIN="jausten@adomain.com,another@adomain.com"
THRESHOLD=90
df -PkH | grep -vE '^Filesystem|tmpfs|cdrom|media' | awk '{ print $5 " " $6 }' | while read output;
do
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@gregersrygg
gregersrygg / README.md
Last active July 28, 2020 17:01
Use a Raspberry Pi as a baby monitor

What you need:

  • Raspberry Pi RevB
  • Raspberry Pi NoIR camera

Download raspbian and install to SD-card. Here is a good guide on how to install the .img file to the card: https://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian

Connect ethernet or wifi, then boot the Raspberry Pi and follow configuration options. Make sure you enable the camera option.

When you get to the command-line:

@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@beeva-enriqueotero
beeva-enriqueotero / docker-neuraltalk2-demo-camera.sh
Last active December 24, 2021 10:19
docker-neuraltalk2 demo
# docker-neuraltalk2 demo with webcam support (Warning: docker-neuraltalk2 image size > 3GB)
# Launch interactive container:
docker run -i -t -p 8000:8000 --privileged -v /dev/video0:/dev/video0 beevaenriqueotero/docker-neuraltalk2 /bin/bash
# And then execute:
git clone https://github.com/Mithul/neuraltalk2.git neuraltalk2-camera
luarocks install camera
cd neuraltalk2-camera/vis
python -m SimpleHTTPServer &
cd ..
@monikkinom
monikkinom / rnn-lstm.py
Last active September 3, 2019 04:44
Tensorflow RNN-LSTM implementation to count number of set bits in a binary string
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/
import numpy as np
import random
from random import shuffle
import tensorflow as tf
# from tensorflow.models.rnn import rnn_cell
# from tensorflow.models.rnn import rnn
NUM_EXAMPLES = 10000
@allwefantasy
allwefantasy / autoencoder-sentence-similarity.py
Last active April 28, 2020 02:39
使用自编码器网络实现语句相似度
import tensorflow as tf
import random
import numpy as np
import time
BASIC_HOME = "/Users/allwefantasy/Downloads"
WORD_VECTOR_FILE = BASIC_HOME + '/laiwen/zhuhl_laiwen_word_embedding'
WORD_FILE = BASIC_HOME + '/laiwen/zhuhl_laiwen_keywords2'
WORD_RESULT_VECTOR_FILE = BASIC_HOME + '/laiwen/WORD_RESULT_VECTOR_FILE4'
MODEL_SAVE_DIR = BASIC_HOME + '/laiwen/model/autoencoder'