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 ( | |
"os" | |
"fmt" | |
"time" | |
) | |
func main () { | |
year := 2022 |
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 | |
LINE="" | |
DRIVES=$(ls /sys/block) | |
for DRIVE in $DRIVES; do | |
if ls /dev/$DRIVE 2>/dev/null >/dev/null && ls /sys/block/$DRIVE/device/delete 2>/dev/null >/dev/null; then | |
SIZE=$(blockdev --getsize64 /dev/$DRIVE | awk '{ split( "B KB MB GB TB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } print int($1) v[s] }') | |
LINE="$LINE p $DRIVE $SIZE" | |
fi | |
done | |
BLOCK=$(zenity --list --title "Choose drive to remove" --radiolist --column="Remove" --column="Device" --column="Size" $LINE) |
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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"time" | |
) | |
func main() { |
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 | |
I=0 | |
while read t; do | |
I=$((I+1)) | |
ID=$(echo $t | cut -d "|" -f 1 | xargs) | |
FIRST=$(echo $t | cut -d "|" -f 2 | xargs) | |
LAST=$(echo $t | cut -d "|" -f 3 | xargs) | |
ADDRESS=$(echo $t | cut -d "|" -f 4 | xargs) | |
CITY=$(echo $t | cut -d "|" -f 5 | xargs) | |
STATE=$(echo $t | cut -d "|" -f 6 | xargs) |
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
importClass(Packages.com.sun.star.uno.UnoRuntime); | |
importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument); | |
importClass(Packages.com.sun.star.container.XIndexAccess); | |
importClass(Packages.com.sun.star.table.XCellRange); | |
importClass(Packages.com.sun.star.table.XCell); | |
importClass(Packages.com.sun.star.text.XText); | |
function parseAddress(addr) { | |
var raddr = addr.split(" ").reverse(); | |
var ret = {zip: raddr[0], state: raddr[1], city: raddr[2], street: ""}; |
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
# sudo ln -s ~/nginx.conf unicorn.conf | |
upstream app_server { | |
server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
charset utf-8; | |
server_name db.innshine.com; |
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
########## | |
# Win10 Initial Setup Script | |
# Author: Disassembler <[email protected]> | |
# Version: 1.7, 2016-08-15 | |
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
# THIS IS A PERSONALIZED VERSION | |
# This script leaves more MS defaults on, including MS security features. | |
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 |
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
function conky_get_age(year, month, day) | |
if conky_window == nil then | |
return | |
end | |
daystoday = os.date("%j") | |
daysatbirth = os.date("%j", os.time{year=year, month=month, day=day}) | |
yearsold = os.date("%Y") - os.date("%Y", os.time{year=year, month=month, day=day}) | |
if daysatbirth > daystoday then | |
yearsold = math.floor(yearsold - 1) | |
dayssince = (365 - daysatbirth) + daystoday |
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
# Keep track of who has three pseudonyms, forgetting one in order to remember a better one | |
class StrategyqualitativeThreeCouchCaller | |
def initialize(parent) | |
@strategy = parent | |
@player = @strategy.player | |
@memory = @strategy.memory | |
end | |
def remember(calledName, calledTeam, calledPosition, calledPseudonym, callerName) | |
# if someone called a number being remembered |
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
greed = 0 | |
flush = 0 | |
10000000.times do | |
dice = [] | |
6.times do | |
dice.push((1..6).to_a.sample) | |
end | |
if dice.include?(1) and dice.include?(2) and dice.include?(3) and dice.include?(4) and dice.include?(5) and dice.include?(6) | |
greed += 1 | |
elsif dice[0] == dice[1] and dice[1] == dice[2] and dice[2] == dice[3] and dice[3] == dice[4] and dice[4] == dice[5] |
NewerOlder