Skip to content

Instantly share code, notes, and snippets.

Avatar
🗨️
#BLM

Gil Creque gilcreque

🗨️
#BLM
View GitHub Profile
View NathanLevineLasertag.js
let Hits = 0
let Health = 0
input.buttonB.onEvent(ButtonEvent.Down, function () {
if (Health == 1) {
pins.A7.digitalWrite(true)
network.infraredSendNumber(Colors.Black)
pins.A7.digitalWrite(false)
}
})
network.onInfraredReceivedNumber(function (receivedNumber) {
@gilcreque
gilcreque / README.MD
Last active Oct 31, 2018 — forked from samdenty/README.MD
VS Code CSS addition to increase readability on file tree.
View README.MD

How to install

Example of file tree

Custom CSS plugin

Install the custom CSS plugin, then make a file on your computer that will hold your custom CSS, I like to make one in my home directory called ~/.vsocde/vscodestyles.css and then add the CSS into it.

@gilcreque
gilcreque / batch-file-examples.bat
Last active Oct 27, 2020
Just showing some basic examples of using a batch files and PowerShell scripts to run commands to help secure a Windows system
View batch-file-examples.bat
rem Guest account has been secured: 10 pts
rem Disable Guest Account
rem https://www.windows-commandline.com/enable-disable-guest-account/
net user guest /active:no
rem A password of at least 8 characters is required: 10 pts
rem Set Minimum Password Length
rem https://www.top-password.com/blog/change-account-lockout-password-complexity-policy-in-windows/
View web-resources.md

Google Fonts

Google has a number of non-standard fonts to use. The way the site works, you create a collection of fonts that you like. Google then gives you an HTML tag to put into your document that links to this collection, which then allows you to utilize the fonts through the font-family property, connecting to Google’s server for the font rather than looking on the user’s computer.

Color Lab

Find compatible colors

@gilcreque
gilcreque / Make-URL-Parameters.py
Last active Aug 18, 2016
Make URL field-value pair parameters from a CSV file and append it to a base URL string
View Make-URL-Parameters.py
#!/usr/bin/env python
import sys
import csv
import re
import urllib
import argparse
def main():
@gilcreque
gilcreque / update-dns.sh
Created Apr 12, 2016 — forked from jfro/update-dns.sh
Linode dynamic DNS updating script
View update-dns.sh
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Uses curl to be compatible with machines that don't have wget by default
LINODE_API_KEY=licensekey
DOMAIN_ID=domainid
RESOURCE_ID=resourceid
WAN_IP=`curl -s http://example.com/whatsmyip.php`
if [ -f $HOME/.wan_ip.txt ]; then
View gist:04761484f8c9461c83da
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@gilcreque
gilcreque / setListInFormsFromSheets.js
Created Jan 22, 2016
Google Script to populate a list in Google Forms from Google Sheets
View setListInFormsFromSheets.js
/**
After any change in the sheet, update the combobox options in the Form
*/
function onChange(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
var range = sheet.getDataRange();
var values = range.getValues();
var comboValues = []; // <-- cheddar will go here
// in this example we are interested in column 0 and discarding row 1 (the titles)
@gilcreque
gilcreque / Shrink MSSQL log file
Created Jan 27, 2015
Shrinking a log file to a specified target size The following example shrinks the log file in the AdventureWorks2008R2 database to 1 MB. To allow the DBCC SHRINKFILE command to shrink the file, the file is first truncated by setting the database recovery model to SIMPLE.
View Shrink MSSQL log file
USE ExampleDB;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE ExampleDB
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (ExampleDB_Log, 1);
View gist:6b7b889acd2eb2c45d5d
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell
if cell == nil {
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier)
}
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary
// Add a check to make sure this exists