Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
export search_cluster="https://search-offcourse-search-development-dtoc6zcl2sm3kwxidih7v4nloi.us-east-1.es.amazonaws.com"
export assets_bucket="offcourse-assets-development"
export raw_resources_bucket="offcourse-raw-resources-development"
export temp_bucket="offcourse-temp-development"
export resources_bucket="offcourse-resources-development"
export bookmarks_bucket="offcourse-bookmarks-development"
export raw_users_bucket="offcourse-raw-users-development"
@garywoodfine
garywoodfine / pbcopyfy
Last active March 13, 2025 00:52
Simple Script to configure pbcopy like functionality on ubuntu
#!/bin/sh
# Copyright (C) 2009-2017 Three Nine Consulting
# Always good practice to update packages. However ask user if they would like to do so
# For explanation on how this works and why check out https://garywoodfine.com/use-pbcopy-on-ubuntu/
read -p "Do you want to update your package repositories before proceeding ? " -n 1 -r
echo #adding new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
fi
@olih
olih / jq-cheetsheet.md
Last active August 27, 2025 17:43
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@stojg
stojg / sleep.ino
Last active January 11, 2025 15:35
Arduino sleep example
// This is an example how to put an arduino board into deep sleep to save on battery power and
// periodically wake up to run some logic. Ideal for sensor stations like plant moisture sensors.
#include "Arduino.h"
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/wdt.h>
// Blink Before sleeping
#define LED_PIN (13)
@xtacocorex
xtacocorex / adctest.c
Last active February 21, 2018 10:24
CHIP Internal ADC Test Code
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>
#define LRADC 0x01C22800
#define CTRL_OFFSET 0x00
@frankhenderson
frankhenderson / file.cljs
Last active January 20, 2019 04:34
learning about channels ... context: ClojureScript, nodejs, spawning a child_process
(ns some-project.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.nodejs :as nodejs]
[cljs.core.async :as a :refer [put! <! chan alts! timeout]]))
(nodejs/enable-util-print!)
(def -main (fn [] nil))
(set! *main-cli-fn* -main)
(def spawn (.-spawn (js/require "child_process")))

Simple Security Guidelines

Using an iDevice? (Best option)

  • Use an iPod or an iPad without a SIM card
  • Use an iPhone
  • Do not jailbreak
  • Always upgrade to new iOS versions
  • Use Brave browser

Need Secure chat?

@patmaddox
patmaddox / exercise_1a_self.rb
Created July 29, 2015 03:23
Messaging - the big idea
class Foo
def foo
puts "I am foo!"
end
def do_foo
# all five are equivalent
foo
self.foo
foo()
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active August 25, 2025 10:09
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@50kudos
50kudos / flashflush.sh
Last active November 3, 2019 02:03
A Bash script that lists all unused css classes in html/haml/erb files for rails project (or maybe others depending on project structure)
#!/bin/bash
cat $(find app/assets/stylesheets/ -type f) |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// |
while read CSS; do
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then
echo $CSS >> unused.scss;
fi
done