Skip to content

Instantly share code, notes, and snippets.

View mlota's full-sized avatar

Mel Lota mlota

View GitHub Profile
@benjeffery
benjeffery / covid_testing_alarm.py
Last active January 28, 2021 12:28
UK Covid testing alarm
import datetime
import time
import requests
import playsound #You might need to install pygobject if you get an error about missing "gi" module for this.
playsound.playsound("ding.mp3") #You'll need a file here that is noisy
while True:
try:
r = requests.post(
"https://ads-prd-gov-1-sp.test-for-coronavirus.service.gov.uk/testcentres/availabilityquery",
@sholloway
sholloway / SOQL Queries.sql
Last active May 16, 2024 17:30
Useful SOQL queries for exploring a Salesforce org.
--------------------------------------------------------------------
-- Queries related to distribution of metadata.
-- Find the number of users per profile.
SELECT count(id), Profile.name
FROM User
WHERE User.IsActive = true
GROUP BY Profile.name
-- Find the distribution of Apex classes per namespace.
select count(id), NameSpacePrefix
@kaplan81
kaplan81 / _testing.md
Last active August 8, 2022 19:27
Angular unit test helpers and samples

Testing

Helpers and examples for unit testing on Angular applications and libraries.

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step).

    git clone git@github...some-repo.git
@kellyrmilligan
kellyrmilligan / s3Sync.sh
Created June 8, 2017 13:38
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@jgamblin
jgamblin / slackspotify.sh
Created April 19, 2017 01:10
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done
@jpierson
jpierson / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git
@jourdan-jobox
jourdan-jobox / conversation.ts
Last active January 24, 2018 12:15
An Ionic 2 example of how to place your page's content above the Keyboard.
import { Platform } from 'ionic-angular';
import { Keyboard } from 'ionic-native';
import { Subscription } from 'Rxjs/rx';
@Component({
selector: 'page-conversation',
templateUrl: 'conversation.html'
})
export class ConversationPage {
@ViewChild(Content) content: Content;
@jondashkyle
jondashkyle / mod-slideshow.js
Last active November 17, 2020 17:23
Slideshow previous and next mod operator
/**
* For some reason I'm always forgetting this.
* Probably because I'm not a mathematician.
*/
let counter = 0
const prev () => {
counter -= 1
}
@DaniSancas
DaniSancas / neo4j_cypher_cheatsheet.md
Created June 14, 2016 23:52
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)