Skip to content

Instantly share code, notes, and snippets.

View syntax-punk's full-sized avatar
👀
noticing things

David syntax-punk

👀
noticing things
View GitHub Profile
@syntax-punk
syntax-punk / FileComparator
Created December 13, 2012 05:52
Current app should compare inputs of one file with another one.
package com.filecomparator.main;
import java.io.*;
public class FileComparator {
private File parent;
private File child;
private BufferedReader brParent;
private BufferedReader brChild;
private StringBuilder parentScope;
@syntax-punk
syntax-punk / core-set.sql
Created November 11, 2018 17:07 — forked from backpackerhh/core-set.sql
SQL - Movie-Rating Query Exercises
-- 1. Find the titles of all movies directed by Steven Spielberg.
SELECT title
FROM Movie
WHERE director = 'Steven Spielberg';
-- 2. Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order.
SELECT DISTINCT year
// THIS IS AN AUTO-GENERATED FILE! Changes to this file will be ignored.
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ffaaaa}",
"initialCols": 120,
"initialRows": 30,
"requestedTheme": "system",
"showTabsInTitlebar": true,
"showTerminalTitleInTitlebar": true,
Import-Module PSColor
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Agnoster
{
"profiles":
[
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ffaaaa}",
"acrylicOpacity" : 0.85,
"name": "Voogie",
"commandline": "powershell.exe",
"hidden": false,
"startingDirectory": "%USERPROFILE%",
@syntax-punk
syntax-punk / clipIt.js
Last active May 24, 2020 12:30
aws js helpers
"use strict";
export const clipIt = (inputId) => {
const node = document.querySelector("#" + inputId);
node.select();
node.setSelectionRange(0, 99999);
document.execCommand("copy");
return node.value;
}
@syntax-punk
syntax-punk / index-1.js
Last active May 25, 2020 18:34
AWS Lambda functions
const AWS = require("aws-sdk");
const { randomize } = require("./randomize.js");
const documentClient = new AWS.DynamoDB.DocumentClient();
exports.handler = async event => {
const { url } = JSON.parse(event.body);
const id = randomize(6);
const params = {
TableName: // dynamoDB,
@syntax-punk
syntax-punk / settings.json
Created May 28, 2020 07:31
VS Code Settings
{
"workbench.colorTheme": "Night Owl",
"editor.fontSize": 14,
"editor.fontFamily": "Dank Mono, Fira Font, Consolas, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.renderWhitespace": "boundary",
"workbench.iconTheme": "vscode-icons",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.fontLigatures": true,
@syntax-punk
syntax-punk / .zsh
Last active March 3, 2021 06:42
vscode & zshrc settings
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:~/Library/Python/3.7/bin:$PATH
// git alias is useful for creating personal short git commands which combine several commands
// alias can be added both locally in the project (git config --local -e)
// and globally to the git user on the given machine (git config --global -e)
[alias]
adog = log --all --decorate --oneline --graph
cob = checkout -b
wip = commit -am "WIP"
undo = reset --soft HEAD~1
hdr = "!f(){ git checkout main && git pull && git checkout - && git rebase main; };f"