Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 23, 2024 15:35
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
# Full code
import hmac
import time
from hashlib import sha256
import subprocess
import requests
secret_key = '' or input('Enter your secret key: ')
public_key = '' or input('Enter your public key: ')
@gurunars
gurunars / ask_confirmation.py
Created May 4, 2016 13:43
Ask for confirmation in Python
def confirm():
"""
Ask user to enter Y or N (case-insensitive).
:return: True if the answer is Y.
:rtype: bool
"""
answer = ""
while answer not in ["y", "n"]:
answer = raw_input("OK to push to continue [Y/N]? ").lower()
anonymous
anonymous / hello.java
Created December 9, 2015 01:38
public class JTestbuild
{
public static void main(String[] args)
{
int i = 0;
while(i < 14)
{
switch(i)
{
case(0):

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@garrettdreyfus
garrettdreyfus / yesOrNo.py
Last active January 18, 2024 15:21
Dead simple python function for getting a yes or no answer.
def yes_or_no(question):
reply = str(raw_input(question+' (y/n): ')).lower().strip()
if reply[0] == 'y':
return True
if reply[0] == 'n':
return False
else:
return yes_or_no("Uhhhh... please enter ")
@Morse-Code
Morse-Code / gist:4122759
Created November 21, 2012 03:03 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@danwdart
danwdart / getrepos.sh
Last active October 13, 2015 02:07
Clones all the repos of a github user (via git+ssh)
wget -O- https://api.github.com/users/$1/repos 2>/dev/null | grep ssh_url | cut -d '"' -f 4 | awk '{ print "git clone " $0 }' | sh
@gre
gre / Application.scala
Created November 12, 2012 11:10
Generate Zip on-the-fly with Play!> Framework (2.1+)
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller {
def zip = Action {
import play.api.libs.iteratee._
import java.util.zip._
@fabiancarlos
fabiancarlos / git_ex_comands.md
Last active October 12, 2015 05:27
Git Essential Comands
git init # initalize a empty git repo
git status # check modifications in the repo repo
git log # check commits in the git repo