Skip to content

Instantly share code, notes, and snippets.

@a1994sc
a1994sc / gist:c5af7b3e0cb9728f5a0a
Created March 23, 2015 17:48
Java - Quickly create a timestamp
new util.sql.Timestamp(Calendar.getInstance().getTime().getTime())
import net.tomp2p.p2p.Peer;
public class Hello {
public static void main(String... args) {
Peer p = null;
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".GroceriesMainActivity">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
@a1994sc
a1994sc / data.txt
Last active June 26, 2016 19:41
Warframe May 2016
Key:
Alt=Alert,Crd=Just Credits,Rew=Reward,Au=Auras
Mo=Mods,Ke=Key,It=Item,Bp=Blueprint,Re=Resource
NE=Nitain Extract,Va=Vauban,Hl=Helmet,Po=Potato
FC=Fusion Core
===================================================
Date Credit Alt Crd Rew Au Mo Ke It Bp Re NE Va Hl Po FC
May 31 451900 49 30 19 2 2 1 1 7 6 4 0 6 0 1
May 30 501000 58 35 23 7 2 3 1 3 7 5 0 2 0 1
May 29 442900 50 31 19 3 0 0 1 5 10 6 0 4 0 0
select trim(SUBSTR(reward, 1, LENGTH(reward) - 6)) as Name,
count(reward) as Occurance
from Alerts as A
where
(
Name in (
select N.Name as Name
from Nightmare as N
) or Name in (
select Au.Name
from base64 import b64decode, b64encode
from Crypto.Cipher import AES
int_offset = 96
def pad(msg):
int_pad = abs((len(msg) % 16) - 16)
if int_pad != 16:
msg += chr(int_pad + int_offset) * int_pad
return msg
@a1994sc
a1994sc / insert_or_update.text
Created September 20, 2016 22:51
A insert or replace to add a number to sql entry.
insert or replace into office
values
(124567,
(select
case
when (select exists(select 1 from office where sku = 124567))
then (select count from office where sku = 124567)
when 1 then 0
end
) + 1
const Discord = require("discord.js")
const reader = require("fs")
const request = require("request")
const client = new Discord.Client()
var config = {}
try {
config = require("./config.json")
} catch(ex) {
config.debug = false
@a1994sc
a1994sc / openpgp.txt
Created October 25, 2018 14:27
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:2032a50d77a3db437791e921f36c4583721e2d4b]
2019/02/07 11:49:30 [crit] 2772#0: *17 connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream, client: <Another IP>, server: web.<My site>, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<External IP>"
2019/02/07 11:50:02 [crit] 2772#0: *19 connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream, client: <Another IP>, server: web.<My site>, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<External IP>"
2019/02/07 11:52:09 [crit] 2772#0: *21 SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking, client: <Another IP>, server: 0.0.0.0:443
2019/02/07 14:01:32 [crit] 2772#0: *23 connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream, client: <Another IP>, server: web.<My site>, request: "GET /cgi-bin/config.exp HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<External IP>"