Skip to content

Instantly share code, notes, and snippets.

Avatar

Taylor buley

  • McNaughton Newspapers, Inc.
  • Winters, California
View GitHub Profile
@jherax
jherax / is-private-mode.js
Last active Apr 24, 2022
Detect if the browser is running in Private mode - Promise based (last update: Feb 2020)
View is-private-mode.js
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*
View gist:e5fe901d80c7a62b15206d703a781b5b
Sacramentio Police and Fire Frequencies
SACRAMENTO COUNTY SHERIFF
Channel 1 Ch1 North patrol/STAR 453.900
Channel 2 Ch2 Records/tactical 453.250
Channel 3 Ch3 South patrol 453.575
Channel 4 Ch4 Long range tac 453.675
Channel 5 Ch5 Short range tac 453.475
Channel 6 Tactical (simplex) 453.950
View Kali 2016.1, Docker Install script
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*
@chrismdp
chrismdp / s3.sh
Last active May 5, 2022
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
View s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@svyatogor
svyatogor / gist:89c9ccbbe3f33cb599bf
Created Apr 22, 2015
upload dSYM to bugsnag after archive:distribution task in your rubymotion project
View gist:89c9ccbbe3f33cb599bf
task "upload_dsym" do
dsym_path = App.config.app_bundle_dsym(App.config.deploy_platform)
app_name = App.config_without_setup.name
`curl https://upload.bugsnag.com/ -F dsym=@"#{dsym_path}/Contents/Resources/DWARF/#{app_name}"`
end
namespace :archive do
task :distribution do
Rake::Task['upload_dsym'].invoke
end
@comerford
comerford / mongo-rocks-startup.log
Last active Aug 29, 2015
Mongo Rocks Startup
View mongo-rocks-startup.log
./mongod --storageEngine=rocksdb
2015-04-03T19:09:38.983+0100 I STORAGE Compression: snappy
2015-04-03T19:09:38.983+0100 I STORAGE MaxWriteMBPerSec: 1024
2015-04-03T19:09:39.042+0100 I CONTROL [initandlisten] MongoDB starting : pid=16433 port=27017 dbpath=/data/db 64-bit host=fed-vm
2015-04-03T19:09:39.042+0100 I CONTROL [initandlisten]
2015-04-03T19:09:39.042+0100 I CONTROL [initandlisten] ** NOTE: This is a development version (3.1.1-pre-) of MongoDB.
2015-04-03T19:09:39.042+0100 I CONTROL [initandlisten] ** Not recommended for production.
2015-04-03T19:09:39.042+0100 I CONTROL [initandlisten]
2015-04-03T19:09:39.043+0100 I CONTROL [initandlisten]
2015-04-03T19:09:39.043+0100 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
@afolarin
afolarin / resource_alloc_docker.md
Last active Apr 15, 2022
Resource Allocation in Docker
View resource_alloc_docker.md

#Container Resource Allocation Options in docker-run

now see: https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources

You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.

##Dynamic CPU Allocation -c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)

@najeira
najeira / gist:280c347ecb6bd9f2e680
Created Aug 15, 2014
Golang BigQuery example
View gist:280c347ecb6bd9f2e680
package main
import (
bigquery "code.google.com/p/google-api-go-client/bigquery/v2"
"code.google.com/p/goauth2/oauth/jwt"
"encoding/json"
"fmt"
)
func main() {
@iand
iand / README.md
Created Jun 26, 2014
Getting started with Cayley
View README.md
@brigand
brigand / app.js
Last active Jun 29, 2017
React JS Event-Emitter Mixin and Example
View app.js
var React = require("react"), Dom = React.DOM;
var LogOutButton = require('./src/logout');
var events = require('api/events');
var Main = React.createClass({
// this mixin provides this.emitLogout, and if we set onLogout it'll be called when "logout" is emitted
mixins: [events.mixinFor("logout")],
getInitialState: function(){
return {