Skip to content

Instantly share code, notes, and snippets.

View yamamushi's full-sized avatar

Will Navidson yamamushi

View GitHub Profile
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active May 4, 2024 22:45
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
@fnky
fnky / ANSI.md
Last active May 6, 2024 16:06
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
var answerHash = '0xdb81b4d58595fbbbb592d3661a34cdca14d7ab379441400cbfa1b78bc447c365';
for(var i=0; i<2000; i++) {
if(web3.sha3(i.toString(16), {encoding: 'hex'}) == answerHash) {
console.log('Answer Found: ' + i);
break;
}
}
@trkrameshkumar
trkrameshkumar / db.go
Created September 6, 2015 07:19
Get get number of rows using sql in golang
package main
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
const (
DB_USER = "ramesh"
@toddanglin
toddanglin / Conditional Formula.md
Last active December 1, 2021 14:53
Creating Conditional "Icon Set" in Google Sheets

Conditional formula for "pie wedge" icon set

=IF(ISTEXT('Sheet1'!A1), "*", IF(ISBLANK('Sheet1'!A1),'Sheet1'!A1, IF('Sheet1'!A1 >= 10, IMAGE("https://docs.google.com/drawings/d/1zvwx-srTZlBYQgO1KNdx9-aB1Bw-GRXCfByBPmW0X_M/pub?w=120&h=90"), IF(AND('Sheet1'!A1 < 10,'Sheet1'!A1 >= 7.5), IMAGE("https://docs.google.com/drawings/d/1YlsedUl2v81KzJjGrmDu90f7Kvc-C4sMQ_EnM40Eei4/pub?w=120&h=90"), IF(AND('Sheet1'!A1 < 7.5,'Sheet1'!A1 >= 5), IMAGE("https://docs.google.com/drawings/d/1IFZiKmFa8zv_7XYxBkIrbJOb_QthS5aNP_VPs3sPbx4/pub?w=120&h=90"), IF(AND('Sheet1'!A1 < 5, 'Sheet1'!A1 >= 2.5),IMAGE("https://docs.google.com/drawings/d/1P0ZZ6bbx1xnhaIDKU34XY_rGzfZIcDbN-dycneMlZ1k/pub?w=120&h=90"),IF('Sheet1'!A1 < 2.5,IMAGE("https://docs.google.com/drawings/d/1gTEKIQuY29SB1HCrcDiT31D0ZsaWaUVMBW_ZW5sjGow/pub?w=120&h=90"),'Sheet1'!A1)))))))

NOTE: "Sheet1" should be replaced with whatever the target sheet name actually is in your Google Sheets document

@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@x684867
x684867 / gist:5381478
Created April 14, 2013 04:37
Brain storming a p2p cryptographic currency idea.
***INITIALIZATION***
1. We assume this starts with some "God" CA that has a publicly trusted certificate. This is the root of the entire system.
2. God CA signs "Alice" certificate, authorizing Alice to act as a market player. Alice is assigned 100u of currency.
3. God CA signs "Bob" certificate, authorizing Bob to act as a market player. Bob is assigned 100u of currency.
4. God CA signs "Charlie" certificate, authorizing Charlie to act as a market player. Charlie is assigned 100u of currency.
***1st MARKET ACTIONS***
1. "Alice" signs "Anna" and gifts "anna" 25u. To sign anna, alice requires signatures of two witnesses.
a. Alice asks Bob and pays Bob a fee of 50% of the transaction (12.5u).
b. Alice asks Charlie and pays Charlie a fee of 50% of the transaction (12.5u).
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@jorgenpt
jorgenpt / stream.sh
Created April 21, 2012 06:59
Commands to stream desktop to justin.tv on OS X
#!/bin/sh -xe
API_KEY="YOUR_API_KEY_GOES_HERE"
FPS="10"
VLC_PATH="/Applications/VLC.app/Contents/MacOS/VLC"
# I don't know how this'll behave on multimon, so you might want to hard-code.
# INRES='1440x900'
INRES=$(osascript -e 'tell application "Finder" to get bounds of window of desktop'|sed 's/, /x/g'|cut -f3- -dx)
OUTRES='1280x800'
# You can change this to record microphone or something else, from man soxformat (under coreaudio):