the bash_profile
snippet will let you run the first file when you press tab
when you have empty command ,
you need to put the cmd
file in your path
and make it executable with chmod +x cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
url=`wl-paste` | |
dest="$HOME/Pictures/wallpaper.jpg" | |
if [[ $url == /* ]]; | |
then | |
echo "copy from $url to $dest"; | |
echo "Copying $url" | |
convert "$url" "$dest" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func ago(t time.Duration) (o string) { | |
const day = time.Hour * 24 | |
const week = day * 7 | |
const month = day * 30 | |
const year = day * 365 | |
const maxPrecision = 2 | |
if t.Seconds() < 1 { | |
return "seconds ago" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a list of ways to say hello in various languages. | |
It is not intended to be comprehensive, but to demonstrate | |
some of the character sets that Emacs supports. | |
Non-ASCII examples: | |
Europe: ¡Hola!, Grüß Gott, Hyvää päivää, Tere õhtust, Bonġu | |
Cześć!, Dobrý den, Здравствуйте!, Γειά σας, გამარჯობა | |
Africa: ሠላም | |
Middle/Near East: שָׁלוֹם, السّلام عليكم | |
South Asia: નમસ્તે, नमस्ते, ನಮಸ್ಕಾರ, നമസ്കാരം, ଶୁଣିବେ, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"reflect" | |
"github.com/gotk3/gotk3/gtk" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Explainer < ActiveSupport::LogSubscriber | |
def sql(event) | |
payload = event.payload | |
return if ignore_payload?(payload) | |
debug color(ActiveRecord::Base.connection.explain(payload[:sql], payload[:binds]), :yellow) | |
end | |
private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cp ~/.config/google-chrome/Default/History /tmp/History | |
sqlite3 /tmp/History "select url, title from urls;" \ | |
| dmenu -i -l 20 -fn "Source Code Pro:regular:size=16" \ | |
| awk 'BEGIN { FS = "|" } ; { print $1 }' \ | |
| xargs xdg-open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require 'bundler/inline' | |
require 'fileutils' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'gtk3' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form id="userform"> | |
<label>Username</label> | |
<input id="username" type="text"> | |
<label>Password</label> | |
<input id="password" type="password"> | |
<label>Other peer Username (only if your the initiator)</label> | |
<input id="to" type="text"> | |
<button onclick="CreateUser()" type="button">Create</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type @" | |
using System; | |
using System.Runtime.InteropServices; | |
public class Tricks { | |
[DllImport("user32.dll")] | |
public static extern IntPtr GetForegroundWindow(); | |
} | |
"@ | |
while($TRUE) |
NewerOlder