Skip to content

Instantly share code, notes, and snippets.

View katz's full-sized avatar

Katsuyuki Sakai katz

View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@talkingmoose
talkingmoose / pvt.talkingmoose.LaunchTextEdit.plist
Last active May 17, 2023 22:41
Example: How to launch a GUI application using launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>pvt.talkingmoose.LaunchTextEdit</string>
<key>ProgramArguments</key>
<array>
@dalethedeveloper
dalethedeveloper / gist:1846552
Created February 16, 2012 17:18
Techniques for Anti-Aliasing @font-face on Windows

#Techniques for Anti-Aliasing @font-face on Windows

It all started with an email from a client: Do these fonts look funky to you? The title is prickly.

The font in question was Port Lligat Sans from Google Web Fonts.

The "prickly" is aliasing caused by lack of hinting

@andsens
andsens / bootstrap_homeshick.sh
Last active December 27, 2023 12:47
Script that can set up an entire user account with homeshick automatically
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'
@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@vvakame
vvakame / Gruntfile.js
Created February 28, 2013 02:32
Slim3 + TypeScript なプロジェクトのGruntfile.jsとか run_server.sh も grunt start-server とかにするべきかなと思う
module.exports = function (grunt) {
grunt.initConfig({
typescript: {
client: { // --declarations --sourcemap --target ES5 --out client/scripts/main.js client/scripts/main.ts
src: ['src/main/typescript/Ignite.ts'],
dest: 'src/main/webapp/scripts/main.js',
options: {
target: 'es5',
base_path: 'src/main/typescript',
sourcemap: false,
@bseibold
bseibold / lazy-ssh-agent.sh
Created February 28, 2013 14:09
Lazy Loading for ssh-agent keys. Loads default SSH identities on demand. Tested with bash and zsh.
function wrapssh() {
setopt shwordsplit &>/dev/null
# load agent if it's not running
if [ -z "$SSH_AUTH_SOCK" ]; then
eval $(ssh-agent) &>/dev/null
fi
# load keys if necessary
DO_ADD=0
@soundTricker
soundTricker / datastore.js
Created May 17, 2013 11:02
Google Apps ScriptからCloud Datastore APIへのクエリ
function myFunction() {
var option = googleOAuth_();
option.method = "post";
option.contentType = 'application/json';
option.payload = JSON.stringify({
"query":
{
"kinds":
[
@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active June 7, 2024 08:38
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;