Skip to content

Instantly share code, notes, and snippets.

@kingkorf
kingkorf / genesis_public_key
Created February 7, 2018 09:48
genesis_public_key
043e989c80922bb8634d562b21ae1bb80c100299f675fb4b3dedc7d988aa50b8ac17f6453d259da363e731cfc2dbfbca136f990e86054db460e2db1a31a7fee5bb
#!/bin/bash
# Usage: ./deleteOld "bucketname" "30 days"
s3cmd ls s3://$1 | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$2" +%s`
if [[ $createDate -lt $olderThan ]]
<?php
$diff = 450752;
$format = sprintf('%02d:%02d:%02d', ($diff / 3600), ($diff / 60 % 60), $diff % 60);
echo $format;
@kingkorf
kingkorf / client.go
Last active August 29, 2015 14:09 — forked from spikebike/client.go
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;

Crack Sublime Text 3 (build 3059)

Open sublime_text with vim

sudo vim /opt/sublime_text/sublime_text

Convert to hex

# Install MacTex: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
$ sudo chown -R `whoami` /usr/local/texlive
$ tlmgr update --self
$ tlmgr install ucs
$ tlmgr install etoolbox
# Install pandoc view homebrew
<?xml version="1.0" encoding="UTF-8"?>
<inspections version="1.0" is_locked="false">
<option name="myName" value="Expert Level PHP" />
<option name="myLocal" value="false" />
<inspection_tool class="BadExpressionStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CallerJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CommaExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConstantConditionalExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConstantIfStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ContinueOrBreakFromFinallyBlockJS" enabled="false" level="WARNING" enabled_by_default="false" />
<?php
require 'json.php';
$json = new JSON;
$json->foo->bar->baz = "foo";
$json->foo->biz = "test";
$json->baz = array();
$json->baz[1] = "testing";
<?php
require 'json.php';
$json = new JSON;
$json->foo->bar->baz = "foo";
$json->foo->biz = "test";
$json->baz = array();
$json->baz[1] = "testing";