Skip to content

Instantly share code, notes, and snippets.

@brasic
brasic / main.go
Created February 14, 2024 20:19 — forked from pteich/main.go
Example for using go's sync.errgroup together with signal detection signal.Notify to stop all running goroutines
package main
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@brasic
brasic / locale-c
Created October 12, 2022 15:52 — forked from kxxoling/locale-c
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
@brasic
brasic / ruby_gnuplot_time_series.rb
Created October 6, 2021 14:50 — forked from yuasatakayuki/ruby_gnuplot_time_series.rb
Plot time-series data using Ruby Gnuplot
require "gnuplot"
data=<<EOS
2016-07-19T23:47:53.432Z 33.2
2016-07-19T23:41:59.558Z 33.1
2016-07-19T23:36:06.183Z 32.9
2016-07-19T23:30:09.101Z 32.7
2016-07-19T23:24:15.936Z 32.6
2016-07-19T23:18:19.082Z 32.4
2016-07-19T23:12:20.944Z 32.4
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
decryptedRow += '"Name","URL","Username","Password"';
for(i=0; i<model.length; i++){
@brasic
brasic / gist:8788958
Last active August 29, 2015 13:55 — forked from trcarden/gist:3295935
simulating a real https site in localhost:3000 (OSX)
running https://yourssldomain.com
# generate keys, run in ~/.sslcert
openssl genrsa -des3 -out server.orig.key 2048
openssl rsa -in server.orig.key -out server.key
openssl req -new -key server.key -out server.csr
# set Common Name: yourssldomain.com
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
echo "127.0.0.1 yourssldomain.com" | sudo tee -a /private/etc/hosts
@brasic
brasic / Timings.txt
Created December 3, 2012 18:43 — forked from jasonroelofs/Timings.txt
Using Go for embarrassingly parallel scripts
] wc -l domains.txt
783 domains.txt
] time go run domain_lookup_parallel.go
real 0m5.743s
user 0m0.359s
sys 0m0.355s
] time go run domain_lookup_sequential.go
@brasic
brasic / .gitignore
Created November 30, 2012 18:59 — forked from karmi/.gitignore
`tail -f` in Node.js and WebSockets
.DS_Store
*.log
tmp/
@brasic
brasic / gist:2961109
Created June 20, 2012 17:40
Building a CentOS 6 Box for Vagrant
@brasic
brasic / gist:1650177
Created January 20, 2012 23:22 — forked from bibendi/gist:1315929
make action and fragment caching of rails 3.0.9 compatible with content_for
module ActionController
class Metal
attr_internal :cached_content_for
end
module Caching
module Actions
def _save_fragment(name, options)
return unless caching_allowed?