This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function()%7Balert(JSON.parse(atob(document.cookie.split(%22%3B%22).map(c%20%3D%3E%20c.trim()).filter(c%20%3D%3E%20c.startsWith(%22reauinf%22))%5B0%5D.split(%22%3D%22)%5B1%5D)).lid)%7D)() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import pytesseract | |
import re | |
cap = cv2.VideoCapture("/Users/Alex/Desktop/untitled folder/Home Movie No 2.m4v") | |
fps = round(cap.get(cv2.CAP_PROP_FPS)) | |
frame_num = 0 | |
NTH_SECONDS = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
# Refer to http://bit.ly/2TF7FU8 on how to find your Bearer and Group GUID | |
link=$(curl -s -X POST \ | |
https://api-ssl.bitly.com/v4/bitlinks \ | |
-H 'Authorization: Bearer XXXXXXXX' \ | |
-H 'Content-Type: application/json' \ | |
-d "{ | |
\"group_guid\": \"XXXXXXXX\", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activate application "Papers" | |
tell application "System Events" | |
tell process "Papers" | |
keystroke "1" using command down | |
set allPapers to text field 1 of row 2 of outline 1 of scroll area 1 of scroll area 1 of group 1 of group 1 of splitter group 1 of group 1 of group 1 of splitter group 1 of group 1 of group 1 of window 1 | |
click allPapers | |
tell table 1 of scroll area 1 of group 1 of group 1 of splitter group 1 of group 1 of splitter group 1 of group 2 of splitter group 1 of group 1 of group 1 of window 1 | |
keystroke "a" using command down | |
keystroke "c" using {command down, control down} | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********* Q1 **********/ | |
int amicable_pair(int n1, int n2) { | |
int sum_factors_n1 = 0, sum_factors_n2 = 0; | |
int i; | |
for (i = 1; i < n1; i++) { | |
if (n1 % i == 0) { | |
sum_factors_n1 += i; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
// | |
// Arbitrary string encapsulator type | |
// | |
typedef struct string_t { | |
char *chars; | |
} string_t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef enum supermarket_t { | |
COLES, WOOLIES, ALDI | |
} supermarket_t; | |
typedef struct product_t { | |
char *name; | |
float price; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================ | |
// = User Input Function in C = | |
// ============================ | |
#include <stdio.h> | |
// | |
// The my_string type can be used to represent a "string" in C. | |
// This needs to be a struct so that it can be returned from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i -e 's/home:/home:windows /g' /etc/nsswitch.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gets the macOS major/minor versions | |
mac_os_major_version=$(sw_vers | grep "ProductVersion:" | sed -e 's/.*10\.\([0-9][0-9]\).*/\1/') | |
mac_os_minor_version=$(sw_vers | grep "ProductVersion:" | sed -e 's/.*10\.[0-9][0-9]\(.*\)/\1/') | |
# macOS Sierra 10.12.2 requires extra config in .ssh/config | |
# See https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ | |
if [ $((mac_os_major_version)) -gt 12 ] || | |
([ $((mac_os_major_version)) -eq 12 ] && [ $((mac_os_minor_version)) -ge 0.2 ]); then | |
cat << EOF >> ~/.ssh/config | |
Host * |
NewerOlder