Skip to content

Instantly share code, notes, and snippets.

View gildotdev's full-sized avatar
:shipit:
Hating the new Copilot pricing changes

gil.dev gildotdev

:shipit:
Hating the new Copilot pricing changes
View GitHub Profile
@gildotdev
gildotdev / setListInFormsFromSheets.js
Created January 22, 2016 21:35
Google Script to populate a list in Google Forms from Google Sheets
/**
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)
@gildotdev
gildotdev / Shrink MSSQL log file
Created January 27, 2015 02:18
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.
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);
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
@gildotdev
gildotdev / createrep.coffee
Last active August 29, 2015 14:01
UltraEdit/Python script file for create CfMC repeat blocks out of a list file
__author__ = 'gilcreque'
MAX_LINE_LEN = 300
UltraEdit.activeDocument.dosToUnix
UltraEdit.activeDocument.selectAll()
text_file = UltraEdit.activeDocument.selection
text_array = text_file.split("\n")
file_len = text_array.length
current_line_len = 0
# See what files changed between branches
git diff --name-status master..branch
@gildotdev
gildotdev / template.php
Created December 18, 2013 03:10
Drupal 7 hook method to remove cache busting query strings on css and js files. Related to this post https://drupal.org/node/242875
<?php
/**
* Implements hook_process_html
*/
function templatenamespace_process_html(&$vars) {
$search = array('scripts' => 'src=', 'styles' => 'href=', 'styles' => '@import\surl\(');
foreach ( $search as $var => $word ) {
if ( !empty($vars[$var]) ) {
@gildotdev
gildotdev / github.html
Last active December 17, 2015 15:29
Github Activity Aside for Octopress
{% if site.github_user %}
<section>
<h2>GitHub Activity</h2>
<ul id="gh_events">
<li class="loading">Status updating...</li>
</ul>
{% if site.github_show_profile_link %}
<a href="https://github.com/{{site.github_user}}">@{{site.github_user}}</a> on GitHub
{% endif %}
<script type="text/javascript">
@gildotdev
gildotdev / MPUG_Notes_2013-05-06.md
Last active December 17, 2015 01:39
Melbourne Python Users Group - May 6th 2013
@gildotdev
gildotdev / GREL Capitalize Syntax
Created March 29, 2013 00:57
Google Refine Expression Language (GREL) Syntax that will capitalize every word
join(
forEach(
value.trim().split(" "),
v,
v.substring(0,1).toUppercase() + v.substring(1)
)
," ")
@gildotdev
gildotdev / subject.bas
Created February 15, 2012 21:41
This Outlook macro will allow you to append tags to the subject line of any message currently selected. To add a macro you must enable the developer menu in Outlook's options. This is based on code I found here http://www.vbaexpress.com/forum/showthread.
Attribute VB_Name = "Subject"
Sub AppendTags()
On Error Resume Next
Dim MsgColl As Object
Dim msg As Outlook.mailItem
Dim objNS As Outlook.NameSpace
Dim i As Long
Dim subjectname As String
Select Case TypeName(Application.ActiveWindow)